amiga_boottest

view Makefile @ 4:995d42b33974

serial output
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 23 Feb 2018 13:29:37 +0200
parents 48093e4bd99a
children
line source
1 src = $(wildcard src/*.c)
2 asrc = $(wildcard src/*.s)
3 obj = $(src:.c=.o) $(asrc:.s=.o)
5 name = test
6 elf = $(name).elf
7 bin = $(name).bin
8 adf = $(name).adf
9 bootblock = boot.bin
11 tool_prefix = m68k-linux-gnu-
13 CC = $(tool_prefix)gcc
14 AS = $(tool_prefix)as
15 LD = $(tool_prefix)ld
16 OBJCOPY = $(tool_prefix)objcopy
18 ASFLAGS = -m68000
19 CFLAGS = -m68000 -ffreestanding -pedantic -Wall -O3
20 LDFLAGS = -T amiga.ld -print-gc-sections \
21 -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc
23 $(adf): $(bin) $(bootblock)
24 tools/mk_adf.py $(bootblock) $(bin) $@
26 $(bin): $(elf)
27 $(OBJCOPY) -O binary $< $@
29 $(elf): $(obj)
30 $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
32 $(bootblock): src/boot/boot.o
33 $(OBJCOPY) -O binary $< $@
35 .PHONY: clean
36 clean:
37 rm -f $(obj) src/boot/boot.o $(bin) $(elf)
39 .PHONY: run
40 run:
41 fs-uae