Linus Nielsen Feltzing | 257d17d | 2002-04-20 23:18:14 +0000 | [diff] [blame] | 1 | CC = sh-elf-gcc |
| 2 | LD = sh-elf-ld |
| 3 | AR = sh-elf-ar |
| 4 | AS = sh-elf-as |
| 5 | OC = sh-elf-objcopy |
| 6 | |
| 7 | INCLUDES=-I../../ |
| 8 | |
| 9 | CFLAGS = -g -Wall -m1 -nostdlib -Wstrict-prototypes -fomit-frame-pointer -fschedule-insns -fno-builtin $(INCLUDES) |
| 10 | AFLAGS += -small -relax |
| 11 | |
Linus Nielsen Feltzing | 7503957 | 2002-04-22 11:54:50 +0000 | [diff] [blame^] | 12 | OBJS= crt0.o main.o ../../i2c.o ../../mas.o ../../debug.o |
Linus Nielsen Feltzing | 257d17d | 2002-04-20 23:18:14 +0000 | [diff] [blame] | 13 | |
| 14 | %.o: %.S |
| 15 | $(CC) -o $@ $(CFLAGS) $(INCLUDES) $(DEFS) -c $< |
| 16 | |
| 17 | |
| 18 | all : archos.mod |
| 19 | |
| 20 | main.o: main.c |
| 21 | |
| 22 | archos.elf : $(OBJS) app.lds |
| 23 | $(CC) -nostartfiles -o archos.elf $(OBJS) -lgcc -Tapp.lds -Wl,-Map,archos.map |
| 24 | |
| 25 | archos.bin : archos.elf |
| 26 | $(OC) -O binary archos.elf archos.bin |
| 27 | |
| 28 | archos.asm: archos.bin |
| 29 | sh2d -sh1 archos.bin > archos.asm |
| 30 | |
| 31 | archos.mod : archos.bin |
| 32 | scramble archos.bin archos.mod |
| 33 | |
| 34 | archos.mod.gz : archos.mod |
| 35 | gzip -f archos.mod |
| 36 | |
| 37 | dist: |
| 38 | tar czvf dist.tar.gz Makefile main.c start.s app.lds |
| 39 | |
| 40 | clean: |
| 41 | -rm -f *.x *.i *.o *.elf *.bin *.map *.mod *.bak *~ |
| 42 | |
| 43 | install: |
| 44 | mount /mnt/archos; cp archos.mod /mnt/archos; umount /mnt/archos |