1 src = $(wildcard src/*.c) \
2 $(wildcard src/amiga/*.c)
3 asrc = $(wildcard src/*.s) \
4 $(wildcard src/amiga/*.s) \
5 $(wildcard src/amiga/libc/*.s)
6 obj = $(src:.c=.o) $(asrc:.s=.o)
15 tool_prefix = m68k-linux-gnu-
17 CC = $(tool_prefix)gcc
20 OBJCOPY = $(tool_prefix)objcopy
22 inc = -Isrc -Isrc/amiga -Isrc/amiga/libc
25 CFLAGS = -m68000 -ffreestanding -pedantic -Wall -Os $(inc)
26 LDFLAGS = -T amiga.ld -print-gc-sections \
27 -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc
29 $(adf): $(bin) $(bootblock)
30 tools/mk_adf.py $(bootblock) $(bin) $@
33 $(OBJCOPY) -O binary $< $@
36 $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
38 $(bootblock): src/amiga/boot/boot.o
39 $(OBJCOPY) -O binary $< $@
44 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
48 rm -f $(obj) src/amiga/boot/boot.o $(bin) $(elf)