1 src = $(wildcard src/*.c) \
2 $(wildcard src/amiga/*.c) \
3 $(wildcard src/amiga/libc/*.c)
4 asrc = $(wildcard src/*.s) \
5 $(wildcard src/amiga/*.s) \
6 $(wildcard src/amiga/libc/*.s)
7 obj = $(src:.c=.o) $(asrc:.s=.o)
16 tool_prefix = m68k-linux-gnu-
18 CC = $(tool_prefix)gcc
21 OBJCOPY = $(tool_prefix)objcopy
23 inc = -Isrc -Isrc/amiga -Isrc/amiga/libc
26 CFLAGS = -m68000 -ffreestanding -pedantic -Wall -Os $(inc)
27 LDFLAGS = -T amiga.ld -print-gc-sections \
28 -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc
30 $(adf): $(bin) $(bootblock)
31 tools/mk_adf.py $(bootblock) $(bin) $@
34 $(OBJCOPY) -O binary $< $@
37 $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
39 $(bootblock): src/amiga/boot/boot.o
40 $(OBJCOPY) -O binary $< $@
45 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
49 rm -f $(obj) src/amiga/boot/boot.o $(bin) $(elf)