megadrive_test1

annotate Makefile @ 0:909c22dc18d2

initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 30 Jan 2017 08:21:53 +0200
parents
children 9e7f64c4fe7a
rev   line source
nuclear@0 1 asrc = $(wildcard src/*.s)
nuclear@0 2 aSsrc = $(wildcard src/*.S)
nuclear@0 3 obj = $(asrc:.s=.o) $(aSsrc:.S=.o)
nuclear@0 4
nuclear@0 5 name = test1
nuclear@0 6 elf = $(name).elf
nuclear@0 7 bin = $(name).bin
nuclear@0 8
nuclear@0 9 warn = -pedantic -Wall
nuclear@0 10 dbg = -g
nuclear@0 11 def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\"
nuclear@0 12
nuclear@0 13 tool_prefix = m68k-linux-gnu-
nuclear@0 14
nuclear@0 15 CC = $(tool_prefix)gcc
nuclear@0 16 AS = $(tool_prefix)as
nuclear@0 17 LD = $(tool_prefix)ld
nuclear@0 18 OBJCOPY = $(tool_prefix)objcopy
nuclear@0 19
nuclear@0 20 CFLAGS = -m68000 -nostdinc -fno-builtin $(warn) $(dbg) $(opt) $(def)
nuclear@0 21 ASFLAGS = -m68000
nuclear@0 22 LDFLAGS = -T megadrive.ldscript -print-gc-sections
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 $@ $(LDFLAGS) $(obj) -Map link.map
nuclear@0 29
nuclear@0 30 .PHONY: clean
nuclear@0 31 clean:
nuclear@0 32 rm -f $(obj) $(elf) $(bin)