Change %mp tag to use current_playmode(). It has upto 9 values now, including recordi...
[kugel-rb.git] / flash / bootbox / Makefile
blob7ef5364a6e133e8d827add23cd91503f4fd2d1af
1 # __________ __ ___.
2 # Open \______ \ ____ ____ | | _\_ |__ _______ ___
3 # Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4 # Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5 # Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6 # \/ \/ \/ \/ \/
7 # $Id$
10 INCLUDES= $(TARGET_INC) -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \
11 -I$(BUILDDIR)
13 DEPFILE = $(OBJDIR)/dep-bootbox
14 LDS := $(FIRMDIR)/target/$(CPU)/$(MANUFACTURER)/app.lds
16 ifdef DEBUG
17 DEFINES := -DDEBUG
18 CFLAGS += -g
19 endif
21 SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
22 DIRS = .
24 ifdef APPEXTRA
25 DIRS += $(subst :, ,$(APPEXTRA))
26 INCLUDES += $(patsubst %,-I%,$(subst :, ,$(APPEXTRA)))
27 endif
29 CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \
30 -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
32 OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
33 SOURCES = $(SRC)
34 LINKFILE = $(OBJDIR)/linkage.lds
35 MAXINFILE = $(OBJDIR)/romstart.temp
36 MAXOUTFILE = $(OBJDIR)/romstart
38 LIBROCKBOX = $(BUILDDIR)/librockbox.a
40 all: $(BUILDDIR)/$(BINARY) $(FLASHFILE)
42 dep: $(DEPFILE)
44 $(LINKFILE): $(LDS)
45 $(call PRINTS,Build $(@F))cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
47 $(MAXOUTFILE):
48 $(SILENT)echo '#include "config.h"' > $(MAXINFILE)
49 $(SILENT)echo "ROM_START" >> $(MAXINFILE)
50 $(SILENT)cat $(MAXINFILE) | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - > $(MAXOUTFILE)
51 $(SILENT)rm $(MAXINFILE)
53 $(OBJDIR)/bootbox.elf : $(OBJS) $(LINKFILE) $(DEPFILE) $(LIBROCKBOX)
54 $(call PRINTS,LD $(@F))$(CC) $(GCCOPTS) -Wl,--gc-sections -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/bootbox.map
56 $(OBJDIR)/bootbox.bin : $(OBJDIR)/bootbox.elf
57 $(call PRINTS,OBJCOPY $(@F))$(OC) -O binary $< $@
59 $(OBJDIR)/bootbox.asm: $(OBJDIR)/bootbox.bin
60 $(TOOLSDIR)/sh2d -sh1 $< > $@
62 $(BUILDDIR)/$(BINARY) : $(OBJDIR)/bootbox.bin
63 $(call PRINTS,Build bootbox file)$(MKFIRMWARE) $< $@
65 $(FLASHFILE): $(OBJDIR)/bootbox.bin
66 $(call PRINTS,UCLPACK bootbox)$(TOOLSDIR)/uclpack --best --2e $< $@ >/dev/null 2>&1;
68 include $(TOOLSDIR)/make.inc
70 clean:
71 $(call PRINTS,cleaning bootbox)-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/bootbox.asm $(OBJDIR)/rockbox.ucl \
72 $(OBJDIR)/bootbox.bin $(OBJDIR)/bootbox.elf $(OBJDIR)/*.map \
73 $(LINKFILE) $(MAXOUTFILE) $(DEPFILE) $(FLASHFILE)
75 -include $(DEPFILE)