gba-x3dtest

annotate Makefile @ 17:0a7f402892b3

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