1 src = $(wildcard src/*.c)
2 ssrc = $(wildcard src/*.s) data/lut.s
3 obj = $(src:.c=.o) $(ssrc:.s=.o)
9 libs = libs/maxmod/libmm.a
11 TCPREFIX = arm-none-eabi-
16 OBJCOPY = $(TCPREFIX)objcopy
17 OBJDUMP = $(TCPREFIX)objdump
19 opt = -O0 -fomit-frame-pointer -mcpu=arm7tdmi -mtune=arm7tdmi -mthumb -mthumb-interwork
21 inc = -I. -Ilibs/maxmod
23 CFLAGS = $(opt) $(dbg) -pedantic -Wall -MMD $(def) $(inc)
24 ASFLAGS = -mthumb-interwork
25 LDFLAGS = -mthumb -mthumb-interwork $(libs) -lm
33 $(OBJCOPY) -O binary $(elf) $(bin)
36 $(elf): $(obj) $(libs)
37 $(CC) -o $(elf) $(obj) -specs=gba.specs -Wl,-Map,link.map $(LDFLAGS)
41 src/data.o: src/data.s $(data)
43 tools/pngdump/pngdump:
44 $(MAKE) -C tools/pngdump
46 tools/lutgen: tools/lutgen.c
49 tools/vistab: tools/vistab.c
53 $(MAKE) -C tools/mmutil
55 %.sraw: %.png tools/pngdump/pngdump
56 tools/pngdump/pngdump -o $@ -oc $(subst .sraw,.spal,$@) -os $(subst .sraw,.shade,$@) -s 8 $<
58 %.raw: %.png tools/pngdump/pngdump
59 tools/pngdump/pngdump -o $@ -n $<
61 %.pal: %.png tools/pngdump/pngdump
62 tools/pngdump/pngdump -o $@ -c $<
64 data/lut.s: tools/lutgen
67 data/snd.bin: $(audata) tools/mmutil/mmutil
68 tools/mmutil/mmutil -o$@ -hdata/snd.h $(audata)
70 data/snd.h: data/snd.bin
74 rm -f $(obj) $(bin) $(bin_mb) $(elf) $(elf_mb)
82 $(MAKE) -C libs/maxmod clean
105 $(MAKE) -C libs/maxmod