diff options
Diffstat (limited to 'firmware/Makefile')
-rw-r--r-- | firmware/Makefile | 47 |
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 | |||
10 | HPATH = /usr/local/sh-gcc/bin | ||
11 | CC = $(HPATH)/sh-elf-gcc | ||
12 | LD = $(HPATH)/sh-elf-ld | ||
13 | AR = $(HPATH)/sh-elf-ar | ||
14 | AS = $(HPATH)/sh-elf-as | ||
15 | OC = $(HPATH)/sh-elf-objcopy | ||
16 | |||
17 | INCLUDES=-I. | ||
18 | |||
19 | CFLAGS = -Os -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns $(INCLUDES) | ||
20 | AFLAGS += -small -relax | ||
21 | |||
22 | SRC := $(wildcard *.c) | ||
23 | OBJS := $(SRC:%.c=%.o) | ||
24 | |||
25 | %.o: %.s | ||
26 | $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< | ||
27 | |||
28 | |||
29 | all : $(OBJS) # archos.mod # archos.asm | ||
30 | |||
31 | archos.elf : $(OBJS) app.lds | ||
32 | $(CC) -nostdlib -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map | ||
33 | |||
34 | archos.bin : archos.elf | ||
35 | $(OC) -O binary archos.elf archos.bin | ||
36 | |||
37 | archos.asm: archos.bin | ||
38 | sh2d -sh1 archos.bin > archos.asm | ||
39 | |||
40 | archos.mod : archos.bin | ||
41 | scramble archos.bin archos.mod | ||
42 | |||
43 | dist: | ||
44 | tar czvf dist.tar.gz Makefile main.c start.s app.lds | ||
45 | |||
46 | clean: | ||
47 | -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ | ||