summaryrefslogtreecommitdiffstats
path: root/flash/bootbox/Makefile
diff options
context:
space:
mode:
authorJörg Hohensohn <hohensoh@rockbox.org>2005-06-21 00:11:14 +0000
committerJörg Hohensohn <hohensoh@rockbox.org>2005-06-21 00:11:14 +0000
commit9cfa47a22647a293ea1697456fcdbaddc975830c (patch)
tree81c5bb8ab3e27f28b4261cff76a2d86b9da809b4 /flash/bootbox/Makefile
parentb6bd58261a253577dad9a7a5496d7717f9f6e4b8 (diff)
downloadrockbox-9cfa47a22647a293ea1697456fcdbaddc975830c.tar.gz
rockbox-9cfa47a22647a293ea1697456fcdbaddc975830c.tar.bz2
rockbox-9cfa47a22647a293ea1697456fcdbaddc975830c.zip
"Bootbox" is a minimalistic rescue firmware for Archos models. Not working yet (Rolo problems). Created by configure script as bootloader.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6786 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'flash/bootbox/Makefile')
-rw-r--r--flash/bootbox/Makefile85
1 files changed, 85 insertions, 0 deletions
diff --git a/flash/bootbox/Makefile b/flash/bootbox/Makefile
new file mode 100644
index 0000000000..26de92fb57
--- /dev/null
+++ b/flash/bootbox/Makefile
@@ -0,0 +1,85 @@
+# __________ __ ___.
+# Open \______ \ ____ ____ | | _\_ |__ _______ ___
+# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+# \/ \/ \/ \/ \/
+# $Id$
+#
+
+INCLUDES= -I$(FIRMDIR)/include -I$(FIRMDIR)/export -I. -I$(OBJDIR) \
+ -I$(BUILDDIR)
+
+DEPFILE = $(OBJDIR)/dep-bootbox
+LDS := $(FIRMDIR)/app.lds
+
+ifdef DEBUG
+ DEFINES := -DDEBUG
+ CFLAGS += -g
+endif
+
+SRC := $(shell cat SOURCES | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P -include "config.h" - )
+DIRS = .
+
+ifdef APPEXTRA
+ DIRS += $(APPEXTRA)
+ INCLUDES += -I$(APPEXTRA)
+endif
+
+CFLAGS = $(GCCOPTS) $(INCLUDES) $(TARGET) $(DEFINES) \
+ -DAPPSVERSION=\"$(VERSION)\" $(EXTRA_DEFINES) -DMEM=${MEMORYSIZE}
+
+OBJS := $(SRC:%.c=$(OBJDIR)/%.o)
+SOURCES = $(SRC)
+LINKFILE = $(OBJDIR)/linkage.lds
+MAXINFILE = $(OBJDIR)/romstart.temp
+MAXOUTFILE = $(OBJDIR)/romstart
+
+all: $(BUILDDIR)/$(BINARY) $(FLASHFILE)
+
+dep: $(DEPFILE)
+
+$(LINKFILE): $(LDS)
+ @echo "Build LDS file"
+ @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
+
+$(MAXOUTFILE):
+ @echo '#include "config.h"' > $(MAXINFILE)
+ @echo "ROM_START" >> $(MAXINFILE)
+ @cat $(MAXINFILE) | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - > $(MAXOUTFILE)
+ @rm $(MAXINFILE)
+
+$(OBJDIR)/bootbox.elf : $(OBJS) $(LINKFILE) $(DEPFILE)
+ @echo "LD bootbox.elf"
+ $(CC) $(GCCOPTS) -Wl,--gc-sections -Os -nostdlib -o $@ $(OBJS) -L$(BUILDDIR) -L$(BUILDDIR)/firmware -lrockbox -lgcc -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/bootbox.map
+
+$(OBJDIR)/bootbox.bin : $(OBJDIR)/bootbox.elf
+ @echo "OBJCOPY $<"
+ @$(OC) -O binary $< $@
+
+$(OBJDIR)/bootbox.asm: $(OBJDIR)/bootbox.bin
+ $(TOOLSDIR)/sh2d -sh1 $< > $@
+
+$(BUILDDIR)/$(BINARY) : $(OBJDIR)/bootbox.bin
+ @echo "Build bootbox file"
+ @$(MKFIRMWARE) $< $@
+
+$(FLASHFILE): $(OBJDIR)/bootbox.bin
+ @a=`uclpack -h 2>/dev/null`; \
+ if test -n "$$a"; then \
+ echo "UCLPACK bootbox" ; \
+ uclpack --best --2e $< $@ >/dev/null 2>&1; \
+ else \
+ echo "no uclpack command found, makes a fake bootbox.ucl"; \
+ echo "fake" > $@; \
+ fi
+
+include $(TOOLSDIR)/make.inc
+
+clean:
+ @echo "cleaning bootbox"
+ @-rm -f $(OBJS) $(BUILDDIR)/$(BINARY) $(OBJDIR)/bootbox.asm $(OBJDIR)/rockbox.ucl \
+ $(OBJDIR)/bootbox.bin $(OBJDIR)/bootbox.elf $(OBJDIR)/*.map \
+ $(LINKFILE) $(MAXOUTFILE) $(DEPFILE)
+
+-include $(DEPFILE)