gba-x3dtest

view Makefile @ 8:fb0a0d6a8b52

sortof works
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 19 Jun 2014 05:53:46 +0300
parents b7130fe3f073
children b755fb002f17
line source
1 src = $(filter-out src/main_sdl.c,$(wildcard src/*.c))
2 obj = $(src:.c=.o)
3 dep = $(obj:.o=.d)
4 name = trycatch
5 elf = $(name).elf
6 bin = $(name).gba
7 elf_mb = $(name)_mb.elf
8 bin_mb = $(name)_mb.gba
10 ARCH = arm-none-eabi
12 CPP = $(ARCH)-cpp
13 CC = $(ARCH)-gcc
14 AS = $(ARCH)-as
15 OBJCOPY = $(ARCH)-objcopy
16 EMU = vbam
18 #opt = -O3 -fomit-frame-pointer -mcpu=arm7tdmi -mtune=arm7tdmi
19 dbg = -g
21 CFLAGS = $(opt) $(dbg) -pedantic -Wall -I../gbasys/src
22 LDFLAGS = ../gbasys/libgbasys.a -lm
23 EMUFLAGS = -T 100 -f 1
25 .PHONY: all
26 all: $(bin) $(bin_mb)
29 $(bin): $(elf)
30 $(OBJCOPY) -O binary $(elf) $(bin)
31 gbafix $(bin)
33 $(bin_mb): $(elf_mb)
34 $(OBJCOPY) -O binary $(elf_mb) $(bin_mb)
35 gbafix $(bin_mb)
37 $(elf): $(obj) ../gbasys/libgbasys.a
38 $(CC) -o $(elf) $(obj) -specs=gba.specs $(LDFLAGS)
40 $(elf_mb): $(obj) ../gbasys/libgbasys.a
41 $(CC) -o $(elf_mb) $(obj) -specs=gba_mb.specs $(LDFLAGS)
43 -include $(dep)
45 %.d: %.c
46 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
48 .PHONY: clean
49 clean:
50 rm -f $(obj) $(dep) $(bin) $(bin_mb) $(elf) $(elf_mb)
52 .PHONY: install
53 install: $(bin)
54 if2a -n -f -W $<
56 .PHONY: run
57 run: $(bin_mb)
58 if2a -m $<
60 .PHONY: simrun
61 simrun: $(bin)
62 $(EMU) $(EMUFLAGS) $(bin)