amiga_boottest

annotate Makefile @ 4:995d42b33974

serial output
author John Tsiombikas <nuclear@member.fsf.org>
date Fri, 23 Feb 2018 13:29:37 +0200
parents 48093e4bd99a
children
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@2 19 CFLAGS = -m68000 -ffreestanding -pedantic -Wall -O3
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@2 37 rm -f $(obj) src/boot/boot.o $(bin) $(elf)
nuclear@2 38
nuclear@2 39 .PHONY: run
nuclear@2 40 run:
nuclear@2 41 fs-uae