1 src = $(wildcard src/*.c)
2 ssrc = $(wildcard src/*.s)
3 obj = $(src:.c=.o) $(ssrc:.s=.o) $(dataobj)
9 data = data/bg.raw data/bg.pal \
23 OBJCOPY = $(ARCH)objcopy
26 opt = -O3 -fomit-frame-pointer -mcpu=arm7tdmi -mtune=arm7tdmi -mthumb -mthumb-interwork
30 CFLAGS = $(opt) $(dbg) -pedantic -Wall -MMD $(def)
31 ASFLAGS = -mthumb-interwork
32 LDFLAGS = -mthumb -mthumb-interwork -lm
33 EMUFLAGS = -T 100 -f 1 --agb-print
40 $(OBJCOPY) -O binary $(elf) $(bin)
44 $(CC) -o $(elf) $(obj) -specs=gba.specs $(LDFLAGS)
48 src/data.o: src/data.s $(data)
50 tools/pngdump/pngdump:
51 $(MAKE) -C tools/pngdump
53 data/sprites.raw: data/sprites1.png data/sprites2.png data/sprites3.png data/sprites4.png data/sprites5.png data/sprites6.png
54 tools/pngdump/pngdump -o $@ -n $^
56 %.raw: %.png tools/pngdump/pngdump
57 tools/pngdump/pngdump -o $@ -n $<
59 %.pal: %.png tools/pngdump/pngdump
60 tools/pngdump/pngdump -o $@ -c $<
64 rm -f $(obj) $(bin) $(bin_mb) $(elf) $(elf_mb)
80 $(EMU) $(EMUFLAGS) $(bin)
84 $(ARCH)objdump -d $< >$@