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:
parent
0099061b90
commit
e1108ab7e6
2 changed files with 41 additions and 24 deletions
|
@ -107,9 +107,23 @@ $(OBJDIR)/rombox.bin : $(OBJDIR)/rombox.elf
|
|||
$(OBJDIR)/rockbox.asm: $(OBJDIR)/rockbox.bin
|
||||
$(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"
|
||||
$(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
|
||||
# this is a simulator build
|
||||
|
|
|
@ -7,43 +7,46 @@
|
|||
# $Id$
|
||||
#
|
||||
|
||||
CC = sh-elf-gcc
|
||||
LD = sh-elf-ld
|
||||
AR = sh-elf-ar
|
||||
AS = sh-elf-as
|
||||
OC = sh-elf-objcopy
|
||||
|
||||
TOOLSDIR=../../tools
|
||||
OBJDIR := .
|
||||
# FIXME: get proper value from build system
|
||||
MEMORYSIZE = 2
|
||||
ifndef V
|
||||
SILENT=@
|
||||
endif
|
||||
|
||||
LDS := link.lds
|
||||
LINKFILE = $(OBJDIR)/linkage.lds
|
||||
OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o
|
||||
|
||||
CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns
|
||||
CFLAGS = $(GCCOPTS)
|
||||
|
||||
all: $(OBJDIR)/compressed.bin
|
||||
|
||||
$(OBJDIR)/compressed.bin : $(OBJDIR)/compressed.elf
|
||||
@echo "OBJCOPY "`basename $@`
|
||||
@$(OC) -O binary $< $@
|
||||
$(SILENT)$(OC) -O binary $< $@
|
||||
|
||||
$(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE)
|
||||
@echo "LD rockbox.elf"
|
||||
@$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map
|
||||
@echo "LD `basename $@`"
|
||||
$(SILENT)$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map
|
||||
|
||||
$(LINKFILE): $(LDS)
|
||||
@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"
|
||||
@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 $< $@
|
||||
|
|
Loading…
Reference in a new issue