Some formatting fixes, reported by Alexander Levin
[kugel-rb.git] / apps / plugins / zxbox / zxbox.make
blob04c85407e14d7fb58a4d2041af84b4fdbca30623
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 ZXBOX_SRCDIR = $(APPSDIR)/plugins/zxbox
11 ZXBOX_OBJDIR = $(BUILDDIR)/apps/plugins/zxbox
13 ZXBOX_SRC := $(call preprocess, $(ZXBOX_SRCDIR)/SOURCES)
14 ZXBOX_OBJ := $(call c2obj, $(ZXBOX_SRC))
16 OTHER_SRC += $(ZXBOX_SRC)
18 ifndef SIMVER
19 ifneq (,$(strip $(foreach tgt,RECORDER ONDIO,$(findstring $(tgt),$(TARGET)))))
20 ## lowmem targets
21 ROCKS += $(ZXBOX_OBJDIR)/zxbox.ovl
22 ZXBOX_OUTLDS = $(ZXBOX_OBJDIR)/zxbox.link
23 ZXBOX_LDFLAGS = -T$(ZXBOX_OUTLDS) -Wl,--gc-sections -Wl,-Map,$(basename $@).map
24 else
25 ### all other targets
26 ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock
27 endif
28 else
29 ### simulator
30 ROCKS += $(ZXBOX_OBJDIR)/zxbox.rock
31 endif
33 ZXBOXFLAGS = $(filter-out -O%,$(PLUGINFLAGS)) -O3 -funroll-loops
35 $(ZXBOX_OBJDIR)/zxbox.rock: $(ZXBOX_OBJ)
37 $(ZXBOX_OBJDIR)/zxbox.refmap: $(ZXBOX_OBJ)
39 $(ZXBOX_OUTLDS): $(PLUGIN_LDS) $(ZXBOX_OBJDIR)/zxbox.refmap
40 $(call PRINTS,PP $(@F))$(call preprocess2file,$<,$@,-DOVERLAY_OFFSET=$(shell \
41 $(TOOLSDIR)/ovl_offset.pl $(ZXBOX_OBJDIR)/zxbox.refmap))
43 $(ZXBOX_OBJDIR)/zxbox.ovl: $(ZXBOX_OBJ) $(ZXBOX_OUTLDS)
44 $(SILENT)$(CC) $(PLUGINFLAGS) -o $(basename $@).elf \
45 $(filter %.o, $^) \
46 $(filter %.a, $+) \
47 -lgcc $(ZXBOX_LDFLAGS)
48 $(call PRINTS,LD $(@F))$(OC) -O binary $(basename $@).elf $@
50 # special pattern rule for compiling zxbox with extra flags
51 $(ZXBOX_OBJDIR)/%.o: $(ZXBOX_SRCDIR)/%.c $(ZXBOX_SRCDIR)/zxbox.make
52 $(SILENT)mkdir -p $(dir $@)
53 $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(ZXBOXFLAGS) -c $< -o $@