amiga_boottest
annotate Makefile @ 1:48093e4bd99a
stuff
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 21 Feb 2018 18:00:45 +0200 |
parents | 51422ea54b9d |
children | 58ebd84822e7 |
rev | line source |
---|---|
nuclear@1 | 1 src = $(wildcard src/*.c) |
nuclear@0 | 2 asrc = $(wildcard src/*.s) |
nuclear@1 | 3 obj = $(src:.c=.o) $(asrc:.s=.o) |
nuclear@0 | 4 |
nuclear@0 | 5 name = test |
nuclear@0 | 6 elf = $(name).elf |
nuclear@0 | 7 bin = $(name).bin |
nuclear@0 | 8 adf = $(name).adf |
nuclear@0 | 9 bootblock = boot.bin |
nuclear@0 | 10 |
nuclear@0 | 11 tool_prefix = m68k-linux-gnu- |
nuclear@0 | 12 |
nuclear@0 | 13 CC = $(tool_prefix)gcc |
nuclear@0 | 14 AS = $(tool_prefix)as |
nuclear@0 | 15 LD = $(tool_prefix)ld |
nuclear@0 | 16 OBJCOPY = $(tool_prefix)objcopy |
nuclear@0 | 17 |
nuclear@0 | 18 ASFLAGS = -m68000 |
nuclear@1 | 19 CFLAGS = -m68000 -pedantic -Wall |
nuclear@0 | 20 LDFLAGS = -T amiga.ld -print-gc-sections \ |
nuclear@0 | 21 -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc |
nuclear@0 | 22 |
nuclear@0 | 23 $(adf): $(bin) $(bootblock) |
nuclear@0 | 24 tools/mk_adf.py $(bootblock) $(bin) $@ |
nuclear@0 | 25 |
nuclear@0 | 26 $(bin): $(elf) |
nuclear@0 | 27 $(OBJCOPY) -O binary $< $@ |
nuclear@0 | 28 |
nuclear@0 | 29 $(elf): $(obj) |
nuclear@0 | 30 $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS) |
nuclear@0 | 31 |
nuclear@0 | 32 $(bootblock): src/boot/boot.o |
nuclear@0 | 33 $(OBJCOPY) -O binary $< $@ |
nuclear@0 | 34 |
nuclear@0 | 35 .PHONY: clean |
nuclear@0 | 36 clean: |
nuclear@0 | 37 rm -f $(obj) $(bin) $(elf) |