megadrive_test1
view Makefile @ 5:f99eab59e7dc
clarified the C code by using VDP macros
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Wed, 01 Feb 2017 14:40:19 +0200 |
parents | 9e7f64c4fe7a |
children | 862f8a034cae |
line source
1 csrc = $(wildcard src/*.c)
2 asrc = $(wildcard src/*.s)
3 aSsrc = $(wildcard src/*.S)
4 obj = $(asrc:.s=.o) $(aSsrc:.S=.o) $(csrc:.c=.o)
6 name = test1
7 elf = $(name).elf
8 bin = $(name).bin
10 warn = -pedantic -Wall
11 dbg = -g
12 def = -DGAMENAME=\"testgame\" -DVERSTR=\"01\"
14 tool_prefix = m68k-linux-gnu-
16 CC = $(tool_prefix)gcc
17 AS = $(tool_prefix)as
18 LD = $(tool_prefix)ld
19 OBJCOPY = $(tool_prefix)objcopy
21 CFLAGS = -m68000 -fno-builtin $(warn) $(dbg) $(opt) $(def)
22 CPPFLAGS = $(def)
23 ASFLAGS = -m68000
24 LDFLAGS = -T megadrive.ldscript -print-gc-sections
26 $(bin): $(elf)
27 $(OBJCOPY) -O binary $< $@
29 $(elf): $(obj)
30 $(LD) -o $@ $(LDFLAGS) $(obj) -Map link.map
32 .PHONY: clean
33 clean:
34 rm -f $(obj) $(elf) $(bin)
36 .PHONY: run
37 run: $(bin)
38 gens-sdl $<