gba-x3dtest

view Makefile @ 18:f907b2c50a8b

added fps bar
author John Tsiombikas <nuclear@member.fsf.org>
date Thu, 26 Jun 2014 21:48:09 +0300
parents 0a7f402892b3
children 62390f9cc93e
line source
1 src = $(filter-out src/main_sdl.c,$(wildcard src/*.c))
2 imgfiles = $(wildcard *.png)
3 obj = $(src:.c=.o) $(imgfiles:.png=.img.o)
4 dep = $(obj:.o=.d)
5 name = x3dtest
6 elf = $(name).elf
7 bin = $(name).gba
8 elf_mb = $(name)_mb.elf
9 bin_mb = $(name)_mb.gba
11 ARCH = arm-none-eabi
13 CPP = $(ARCH)-cpp
14 CC = $(ARCH)-gcc
15 AS = $(ARCH)-as
16 OBJCOPY = $(ARCH)-objcopy
17 EMU = vbam
19 opt = -O3 -fomit-frame-pointer -mcpu=arm7tdmi -mtune=arm7tdmi
20 #dbg = -g
22 CFLAGS = $(opt) $(dbg) -pedantic -Wall -I. -I../gbasys/src
23 LDFLAGS = ../gbasys/libgbasys.a -lm
24 EMUFLAGS = -T 100 -f 1 --agb-print
26 .PHONY: all
27 all: $(bin) $(bin_mb)
30 $(bin): $(elf)
31 $(OBJCOPY) -O binary $(elf) $(bin)
32 gbafix $(bin)
34 $(bin_mb): $(elf_mb)
35 $(OBJCOPY) -O binary $(elf_mb) $(bin_mb)
36 gbafix $(bin_mb)
38 $(elf): $(obj) ../gbasys/libgbasys.a
39 $(CC) -o $(elf) $(obj) -specs=gba.specs $(LDFLAGS)
41 $(elf_mb): $(obj) ../gbasys/libgbasys.a
42 $(CC) -o $(elf_mb) $(obj) -specs=gba_mb.specs $(LDFLAGS)
44 -include $(dep)
46 %.d: %.c
47 @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
49 %.img.c: %.png
50 img2gba $<
52 .PHONY: clean
53 clean:
54 rm -f $(obj) $(dep) $(bin) $(bin_mb) $(elf) $(elf_mb)
56 .PHONY: install
57 install: $(bin)
58 if2a -n -f -W $<
60 .PHONY: run
61 run: $(bin_mb)
62 if2a -m $<
64 .PHONY: simrun
65 simrun: $(bin)
66 $(EMU) $(EMUFLAGS) $(bin)