megadrive_test1

annotate 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
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@1 21 CPPFLAGS = $(def)
nuclear@0 22 ASFLAGS = -m68000
nuclear@0 23 LDFLAGS = -T megadrive.ldscript -print-gc-sections
nuclear@0 24
nuclear@0 25 $(bin): $(elf)
nuclear@0 26 $(OBJCOPY) -O binary $< $@
nuclear@0 27
nuclear@0 28 $(elf): $(obj)
nuclear@0 29 $(LD) -o $@ $(LDFLAGS) $(obj) -Map link.map
nuclear@0 30
nuclear@0 31 .PHONY: clean
nuclear@0 32 clean:
nuclear@0 33 rm -f $(obj) $(elf) $(bin)
nuclear@1 34
nuclear@1 35 .PHONY: run
nuclear@1 36 run: $(bin)
nuclear@1 37 gens-sdl $<