megadrive_test1
view Makefile @ 7:8253942b0a1a
in the middle of something
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 19 Feb 2017 14:00:26 +0200 |
parents | e7138066c7ea |
children |
line source
1 csrc = $(wildcard src/*.c) $(wildcard src/libc/*.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\" -D__NO_CTYPE
13 inc = -Isrc/libc
15 tool_prefix = m68k-linux-gnu-
17 CC = $(tool_prefix)gcc
18 AS = $(tool_prefix)as
19 LD = $(tool_prefix)ld
20 OBJCOPY = $(tool_prefix)objcopy
22 CFLAGS = -m68000 -ffreestanding -fno-builtin $(warn) $(dbg) $(opt) $(def) $(inc)
23 CPPFLAGS = $(def)
24 ASFLAGS = -m68000
25 LDFLAGS = -T megadrive.ldscript -print-gc-sections \
26 -L/usr/lib/gcc-cross/m68k-linux-gnu/6 -lgcc
28 $(bin): $(elf)
29 $(OBJCOPY) -O binary $< $@
31 $(elf): $(obj)
32 $(LD) -o $@ $(obj) -Map link.map $(LDFLAGS)
34 .PHONY: clean
35 clean:
36 rm -f $(obj) $(elf) $(bin)
38 .PHONY: run
39 run: $(bin)
40 gens-sdl $<