summaryrefslogtreecommitdiff
path: root/firmware/decompressor/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/decompressor/Makefile')
-rw-r--r--firmware/decompressor/Makefile47
1 files changed, 25 insertions, 22 deletions
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
10CC = sh-elf-gcc 10ifndef V
11LD = sh-elf-ld 11SILENT=@
12AR = sh-elf-ar 12endif
13AS = sh-elf-as
14OC = sh-elf-objcopy
15
16TOOLSDIR=../../tools
17OBJDIR := .
18# FIXME: get proper value from build system
19MEMORYSIZE = 2
20 13
21LDS := link.lds 14LDS := link.lds
22LINKFILE = $(OBJDIR)/linkage.lds 15LINKFILE = $(OBJDIR)/linkage.lds
23OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o 16OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/uclimage.o $(OBJDIR)/startup.o
24 17CFLAGS = $(GCCOPTS)
25CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns
26 18
27all: $(OBJDIR)/compressed.bin 19all: $(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