summaryrefslogtreecommitdiff
path: root/firmware/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/Makefile')
-rw-r--r--firmware/Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
new file mode 100644
index 0000000000..9b38303be4
--- /dev/null
+++ b/firmware/Makefile
@@ -0,0 +1,47 @@
1# __________ __ ___.
2# Open \______ \ ____ ____ | | _\_ |__ _______ ___
3# Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
4# Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
5# Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
6# \/ \/ \/ \/ \/
7# $Id$
8#
9
10HPATH = /usr/local/sh-gcc/bin
11CC = $(HPATH)/sh-elf-gcc
12LD = $(HPATH)/sh-elf-ld
13AR = $(HPATH)/sh-elf-ar
14AS = $(HPATH)/sh-elf-as
15OC = $(HPATH)/sh-elf-objcopy
16
17INCLUDES=-I.
18
19CFLAGS = -Os -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES)
20AFLAGS += -small -relax
21
22SRC := $(wildcard *.c)
23OBJS := $(SRC:%.c=%.o)
24
25%.o: %.s
26 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
27
28
29all : $(OBJS) # archos.mod # archos.asm
30
31archos.elf : $(OBJS) app.lds
32 $(CC) -nostdlib -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map
33
34archos.bin : archos.elf
35 $(OC) -O binary archos.elf archos.bin
36
37archos.asm: archos.bin
38 sh2d -sh1 archos.bin > archos.asm
39
40archos.mod : archos.bin
41 scramble archos.bin archos.mod
42
43dist:
44 tar czvf dist.tar.gz Makefile main.c start.s app.lds
45
46clean:
47 -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~