blob: 4f004f8333654e8e8de68fac2c46585d7515e5d5 [file] [log] [blame]
Linus Nielsen Feltzing257d17d2002-04-20 23:18:14 +00001CC = sh-elf-gcc
2LD = sh-elf-ld
3AR = sh-elf-ar
4AS = sh-elf-as
5OC = sh-elf-objcopy
6
Linus Nielsen Feltzingd8516442002-04-23 13:15:40 +00007INCLUDES=-I../.. -I../../drivers
Linus Nielsen Feltzing257d17d2002-04-20 23:18:14 +00008
Linus Nielsen Feltzing8307cfd2002-05-02 21:23:04 +00009CFLAGS = -g -Wall -m1 -nostdlib -Wstrict-prototypes -fschedule-insns -fno-builtin $(INCLUDES) -DDEBUG
Linus Nielsen Feltzing257d17d2002-04-20 23:18:14 +000010AFLAGS += -small -relax
11
Linus Nielsen Feltzing8307cfd2002-05-02 21:23:04 +000012OBJS= crt0.o main.o ../../drivers/i2c.o ../../drivers/mas.o ../../debug.o \
13 ../../common/sprintf.o
Linus Nielsen Feltzing257d17d2002-04-20 23:18:14 +000014
15%.o: %.S
16 $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $<
17
18
19all : archos.mod
20
21main.o: main.c
22
23archos.elf : $(OBJS) app.lds
24 $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map
25
26archos.bin : archos.elf
27 $(OC) -O binary archos.elf archos.bin
28
29archos.asm: archos.bin
30 sh2d -sh1 archos.bin > archos.asm
31
32archos.mod : archos.bin
33 scramble archos.bin archos.mod
34
35archos.mod.gz : archos.mod
36 gzip -f archos.mod
37
38dist:
39 tar czvf dist.tar.gz Makefile main.c start.s app.lds
40
41clean:
Linus Nielsen Feltzing3236c352002-04-23 21:43:14 +000042 -rm -f $(OBJS) *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~
Linus Nielsen Feltzing257d17d2002-04-20 23:18:14 +000043
44install:
45 mount /mnt/archos; cp archos.mod /mnt/archos; umount /mnt/archos