summaryrefslogtreecommitdiff
path: root/firmware/decompressor/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/decompressor/Makefile')
-rw-r--r--firmware/decompressor/Makefile42
1 files changed, 42 insertions, 0 deletions
diff --git a/firmware/decompressor/Makefile b/firmware/decompressor/Makefile
new file mode 100644
index 0000000000..99e91aa35e
--- /dev/null
+++ b/firmware/decompressor/Makefile
@@ -0,0 +1,42 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10CC = sh-elf-gcc
11LD = sh-elf-ld
12AR = sh-elf-ar
13AS = sh-elf-as
14OC = sh-elf-objcopy
15
16TOOLSDIR=../../tools
17OBJDIR := .
18# FIXME: get proper value from build system
19MEMORYSIZE = 2
20
21
22LDS := link.lds
23LINKFILE = $(OBJDIR)/linkage.lds
24OBJS := $(OBJDIR)/decompressor.o $(OBJDIR)/rockboxucl.o
25
26CFLAGS = -O -W -Wall -m1 -nostdlib -ffreestanding -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns
27
28$(OBJDIR)/compressed.bin : $(OBJDIR)/compressed.elf
29 @echo "OBJCOPY "`basename $@`
30 @$(OC) -O binary $< $@
31
32$(OBJDIR)/compressed.elf : $(OBJS) $(LINKFILE)
33 @echo "LD rockbox.elf"
34 @$(CC) $(GCCOPTS) -Os -nostdlib -o $@ $(OBJS) -T$(LINKFILE) -Wl,-Map,$(OBJDIR)/compressed.map
35
36$(LINKFILE): $(LDS)
37 @echo "Build LDS file"
38 @cat $< | $(CC) -DMEMORYSIZE=$(MEMORYSIZE) $(INCLUDES) $(TARGET) $(DEFINES) -E -P $(ROMBUILD) - >$@
39
40$(OBJDIR)/rockboxucl.o: $(OBJDIR)/rockbox.ucl
41 @echo "OBJCOPY rockbox.ucl"
42 @$(OC) -I binary -O elf32-sh -B sh --rename-section .data=.image,alloc,load,data,contents $< $@