amiga_boottest

annotate Makefile @ 0:51422ea54b9d

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