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
This commit is contained in:
Daniel Stenberg 2005-12-05 21:56:56 +00:00
parent 0099061b90
commit e1108ab7e6
2 changed files with 41 additions and 24 deletions

View file

@ -107,9 +107,23 @@ $(OBJDIR)/rombox.bin : $(OBJDIR)/rombox.elf
$(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin $(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin
$(TOOLSDIR)/sh2d -sh1 $< > $@ $(TOOLSDIR)/sh2d -sh1 $< > $@
$(BUILDDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin #
# If there's a flashfile defined for this target (rockbox.ucl for Archos
# models) Then check if the mkfirmware script fails, as then it is (likely)
# because the image is too big and we need to create a compressed image
# instead.
#
$(BUILDDIR)/$(BINARY) : $(OBJDIR)/rockbox.bin $(FLASHFILE)
@echo "Build firmware file" @echo "Build firmware file"
$(SILENT)$(MKFIRMWARE) $< $@ $(SILENT)($(MKFIRMWARE) $< $@; \
stat=$$?; \
if test -n "$(FLASHFILE)"; then \
if test "$$stat" -ne 0; then \
echo "Image too big, making a compressed version!"; \
$(MAKE) -C $(FIRMDIR)/decompressor OBJDIR=$(BUILDDIR)/firmware/decompressor; \
$(MKFIRMWARE) $(BUILDDIR)/firmware/decompressor/compressed.bin $@; \
fi \
fi )
else else
# this is a simulator build # this is a simulator build

View file

@ -7,43 +7,46 @@
# $Id$ # $Id$
# #
CC = sh-elf-gcc ifndef V
LD = sh-elf-ld SILENT=@
AR = sh-elf-ar endif
AS = sh-elf-as
OC = sh-elf-objcopy
TOOLSDIR=../../tools
OBJDIR := .
# FIXME: get proper value from build system
MEMORYSIZE = 2
LDS := link.lds LDS := link.lds
LINKFILE = $(OBJDIR)/linkage.lds LINKFILE = $(OBJDIR)/linkage.lds
OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o
CFLAGS = $(GCCOPTS)
CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns
all: $(OBJDIR)/compressed.bin all: $(OBJDIR)/compressed.bin
$(OBJDIR)/compressed.bin : $(OBJDIR)/compressed.elf $(OBJDIR)/compressed.bin : $(OBJDIR)/compressed.elf
@echo "OBJCOPY "`basename $@` @echo "OBJCOPY "`basename $@`
@$(OC) -O binary $< $@ $(SILENT)$(OC) -O binary $< $@
$(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE) $(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE)
@echo "LD rockbox.elf" @echo "LD `basename $@`"
@$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map $(SILENT)$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map
$(LINKFILE): $(LDS) $(LINKFILE): $(LDS)
@echo "Build LDS file" @echo "Build LDS file"
@cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@ $(SILENT)cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
$(OBJDIR)/decompressor.o : $(OBJDIR)/uclimage.h $(OBJDIR)/decompressor.o : decompressor.c $(OBJDIR)/uclimage.c
$(SILENT)mkdir -p `dirname $@`
@echo "CC $<"
$(SILENT)$(CC) $(CFLAGS) -I$(OBJDIR) -c $< -o $@
$(OBJDIR)/uclimage.c : $(OBJDIR)/rockbox.ucl $(TOOLSDIR)/ucl2src.pl $(OBJDIR)/startup.o : startup.S
$(SILENT)mkdir -p `dirname $@`
@echo "AS $<"
$(SILENT)$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/uclimage.o : $(OBJDIR)/uclimage.c
$(SILENT)mkdir -p `dirname $@`
@echo "CC `basename $<`"
$(SILENT)$(CC) $(CFLAGS) -c $< -o $@
$(OBJDIR)/uclimage.c : $(FLASHFILE) $(TOOLSDIR)/ucl2src.pl
$(SILENT)mkdir -p `dirname $@`
@echo "UCL2SRC" @echo "UCL2SRC"
@perl -s $(TOOLSDIR)/ucl2src.pl -p=uclimage $< $@ $(SILENT)perl -s $(TOOLSDIR)/ucl2src.pl -p=$(OBJDIR)/uclimage $<
$(OBJDIR)/uclimage.h : $(OBJDIR)/rockbox.ucl $(TOOLSDIR)/ucl2src.pl
@echo "UCL2SRC"
@perl -s $(TOOLSDIR)/ucl2src.pl -p=uclimage $< $@