megadrive_test1

diff 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 diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Makefile	Mon Jan 30 08:21:53 2017 +0200
     1.3 @@ -0,0 +1,32 @@
     1.4 +asrc = $(wildcard src/*.s)
     1.5 +aSsrc = $(wildcard src/*.S)
     1.6 +obj = $(asrc:.s=.o) $(aSsrc:.S=.o)
     1.7 +
     1.8 +name = test1
     1.9 +elf = $(name).elf
    1.10 +bin = $(name).bin
    1.11 +
    1.12 +warn = -pedantic -Wall
    1.13 +dbg = -g
    1.14 +def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\"
    1.15 +
    1.16 +tool_prefix = m68k-linux-gnu-
    1.17 +
    1.18 +CC = $(tool_prefix)gcc
    1.19 +AS = $(tool_prefix)as
    1.20 +LD = $(tool_prefix)ld
    1.21 +OBJCOPY = $(tool_prefix)objcopy
    1.22 +
    1.23 +CFLAGS = -m68000 -nostdinc -fno-builtin $(warn) $(dbg) $(opt) $(def)
    1.24 +ASFLAGS = -m68000
    1.25 +LDFLAGS = -T megadrive.ldscript -print-gc-sections
    1.26 +
    1.27 +$(bin): $(elf)
    1.28 +	$(OBJCOPY) -O binary $< $@
    1.29 +
    1.30 +$(elf): $(obj)
    1.31 +	$(LD) -o $@ $(LDFLAGS) $(obj) -Map link.map
    1.32 +
    1.33 +.PHONY: clean
    1.34 +clean:
    1.35 +	rm -f $(obj) $(elf) $(bin)