megadrive_test1
view Makefile @ 2:51d1d6761601
copied the bgset code from samurai's article to test that my dev setup is
actually working
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 30 Jan 2017 16:57:51 +0200 |
parents | 909c22dc18d2 |
children | e7138066c7ea |
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 CPPFLAGS = $(def)
22 ASFLAGS = -m68000
23 LDFLAGS = -T megadrive.ldscript -print-gc-sections
25 $(bin): $(elf)
26 $(OBJCOPY) -O binary $< $@
28 $(elf): $(obj)
29 $(LD) -o $@ $(LDFLAGS) $(obj) -Map link.map
31 .PHONY: clean
32 clean:
33 rm -f $(obj) $(elf) $(bin)
35 .PHONY: run
36 run: $(bin)
37 gens-sdl $<