megadrive_test1

view Makefile @ 0:909c22dc18d2

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