diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-12-05 21:56:56 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-12-05 21:56:56 +0000 |
commit | e1108ab7e6dd4dcf11676fbf9f3de34b476bf8c7 (patch) | |
tree | 7f9a513e7d226fc3a1e6b0d0042ddab343e38efb | |
parent | 0099061b903a4a1367b7375248013e0635396361 (diff) | |
download | rockbox-e1108ab7e6dd4dcf11676fbf9f3de34b476bf8c7.tar.gz rockbox-e1108ab7e6dd4dcf11676fbf9f3de34b476bf8c7.zip |
Adjusted the decompressor work to build a compressed image for the Archos
targets in case it is too big to fit.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8158 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/Makefile | 18 | ||||
-rw-r--r-- | firmware/decompressor/Makefile | 47 |
2 files changed, 41 insertions, 24 deletions
diff --git a/apps/Makefile b/apps/Makefile index 4fa225033b..278e1c7118 100644 --- a/apps/Makefile +++ b/apps/Makefile | |||
@@ -107,9 +107,23 @@ $(OBJDIR)/rombox.bin : $(OBJDIR)/rombox.elf | |||
107 | $(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin | 107 | $(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin |
108 | $(TOOLSDIR)/sh2d -sh1 $< > $@ | 108 | $(TOOLSDIR)/sh2d -sh1 $< > $@ |
109 | 109 | ||
110 | $(BUILDDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin | 110 | # |
111 | # If there's a flashfile defined for this target (rockbox.ucl for Archos | ||
112 | # models) Then check if the mkfirmware script fails, as then it is (likely) | ||
113 | # because the image is too big and we need to create a compressed image | ||
114 | # instead. | ||
115 | # | ||
116 | $(BUILDDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin $(FLASHFILE) | ||
111 | @echo "Build firmware file" | 117 | @echo "Build firmware file" |
112 | $(SILENT)$(MKFIRMWARE) $< $@ | 118 | $(SILENT)($(MKFIRMWARE) $< $@; \ |
119 | stat=$$?; \ | ||
120 | if test -n "$(FLASHFILE)"; then \ | ||
121 | if test "$$stat" -ne 0; then \ | ||
122 | echo "Image too big, making a compressed version!"; \ | ||
123 | $(MAKE) -C $(FIRMDIR)/decompressor OBJDIR=$(BUILDDIR)/firmware/decompressor; \ | ||
124 | $(MKFIRMWARE) $(BUILDDIR)/firmware/decompressor/compressed.bin $@; \ | ||
125 | fi \ | ||
126 | fi ) | ||
113 | 127 | ||
114 | else | 128 | else |
115 | # this is a simulator build | 129 | # this is a simulator build |
diff --git a/firmware/decompressor/Makefile b/firmware/decompressor/Makefile index 4136eafdb7..5e4e73912e 100644 --- a/firmware/decompressor/Makefile +++ b/firmware/decompressor/Makefile | |||
@@ -7,43 +7,46 @@ | |||
7 | # $Id$ | 7 | # $Id$ |
8 | # | 8 | # |
9 | 9 | ||
10 | CC = sh-elf-gcc | 10 | ifndef V |
11 | LD = sh-elf-ld | 11 | SILENT=@ |
12 | AR = sh-elf-ar | 12 | endif |
13 | AS = sh-elf-as | ||
14 | OC = sh-elf-objcopy | ||
15 | |||
16 | TOOLSDIR=../../tools | ||
17 | OBJDIR := . | ||
18 | # FIXME: get proper value from build system | ||
19 | MEMORYSIZE = 2 | ||
20 | 13 | ||
21 | LDS := link.lds | 14 | LDS := link.lds |
22 | LINKFILE = $(OBJDIR)/linkage.lds | 15 | LINKFILE = $(OBJDIR)/linkage.lds |
23 | OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o | 16 | OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o |
24 | 17 | CFLAGS = $(GCCOPTS) | |
25 | CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns | ||
26 | 18 | ||
27 | all: $(OBJDIR)/compressed.bin | 19 | all: $(OBJDIR)/compressed.bin |
28 | 20 | ||
29 | $(OBJDIR)/compressed.bin : $(OBJDIR)/compressed.elf | 21 | $(OBJDIR)/compressed.bin : $(OBJDIR)/compressed.elf |
30 | @echo "OBJCOPY "`basename $@` | 22 | @echo "OBJCOPY "`basename $@` |
31 | @$(OC) -O binary $< $@ | 23 | $(SILENT)$(OC) -O binary $< $@ |
32 | 24 | ||
33 | $(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE) | 25 | $(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE) |
34 | @echo "LD rockbox.elf" | 26 | @echo "LD `basename $@`" |
35 | @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map | 27 | $(SILENT)$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map |
36 | 28 | ||
37 | $(LINKFILE): $(LDS) | 29 | $(LINKFILE): $(LDS) |
38 | @echo "Build LDS file" | 30 | @echo "Build LDS file" |
39 | @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ | 31 | $(SILENT)cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ |
40 | 32 | ||
41 | $(OBJDIR)/decompressor.o : $(OBJDIR)/uclimage.h | 33 | $(OBJDIR)/decompressor.o : decompressor.c $(OBJDIR)/uclimage.c |
34 | $(SILENT)mkdir -p `dirname $@` | ||
35 | @echo "CC $<" | ||
36 | $(SILENT)$(CC) $(CFLAGS) -I$(OBJDIR) -c $< -o $@ | ||
42 | 37 | ||
43 | $(OBJDIR)/uclimage.c : $(OBJDIR)/rockbox.ucl $(TOOLSDIR)/ucl2src.pl | 38 | $(OBJDIR)/startup.o : startup.S |
44 | @echo "UCL2SRC" | 39 | $(SILENT)mkdir -p `dirname $@` |
45 | @perl -s $(TOOLSDIR)/ucl2src.pl -p=uclimage $< $@ | 40 | @echo "AS $<" |
41 | $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ | ||
46 | 42 | ||
47 | $(OBJDIR)/uclimage.h : $(OBJDIR)/rockbox.ucl $(TOOLSDIR)/ucl2src.pl | 43 | $(OBJDIR)/uclimage.o : $(OBJDIR)/uclimage.c |
44 | $(SILENT)mkdir -p `dirname $@` | ||
45 | @echo "CC `basename $<`" | ||
46 | $(SILENT)$(CC) $(CFLAGS) -c $< -o $@ | ||
47 | |||
48 | $(OBJDIR)/uclimage.c : $(FLASHFILE) $(TOOLSDIR)/ucl2src.pl | ||
49 | $(SILENT)mkdir -p `dirname $@` | ||
48 | @echo "UCL2SRC" | 50 | @echo "UCL2SRC" |
49 | @perl -s $(TOOLSDIR)/ucl2src.pl -p=uclimage $< $@ | 51 | $(SILENT)perl -s $(TOOLSDIR)/ucl2src.pl -p=$(OBJDIR)/uclimage $< |
52 | |||