nuclear@0: src = $(wildcard src/*.c) nuclear@0: obj = $(src:.c=.o) nuclear@0: dep = $(obj:.o=.d) nuclear@0: name = trycatch nuclear@0: elf = $(name).elf nuclear@0: bin = $(name).gba nuclear@0: elf_mb = $(name)_mb.elf nuclear@0: bin_mb = $(name)_mb.gba nuclear@0: nuclear@0: ARCH = arm-none-eabi nuclear@0: nuclear@0: CPP = $(ARCH)-cpp nuclear@0: CC = $(ARCH)-gcc nuclear@0: AS = $(ARCH)-as nuclear@0: OBJCOPY = $(ARCH)-objcopy nuclear@0: nuclear@0: opt = -O3 -fomit-frame-pointer -marm -mcpu=arm7tdmi -mtune=arm7tdmi nuclear@0: nuclear@0: CFLAGS = $(opt) -pedantic -Wall -I../gbasys/src -I. nuclear@0: LDFLAGS = ../gbasys/libgbasys.a -lm nuclear@0: nuclear@0: .PHONY: all nuclear@0: all: $(bin) $(bin_mb) nuclear@0: nuclear@0: nuclear@0: $(bin): $(elf) nuclear@0: $(OBJCOPY) -O binary $(elf) $(bin) nuclear@0: gbafix $(bin) nuclear@0: nuclear@0: $(bin_mb): $(elf_mb) nuclear@0: $(OBJCOPY) -O binary $(elf_mb) $(bin_mb) nuclear@0: gbafix $(bin_mb) nuclear@0: nuclear@0: $(elf): $(obj) ../gbasys/libgbasys.a nuclear@0: $(CC) -o $(elf) $(obj) -specs=gba.specs $(LDFLAGS) nuclear@0: nuclear@0: $(elf_mb): $(obj) ../gbasys/libgbasys.a nuclear@0: $(CC) -o $(elf_mb) $(obj) -specs=gba_mb.specs $(LDFLAGS) nuclear@0: nuclear@0: -include $(dep) nuclear@0: nuclear@0: %.d: %.c nuclear@0: @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@ nuclear@0: nuclear@0: .PHONY: clean nuclear@0: clean: nuclear@0: rm -f $(obj) $(dep) $(bin) $(bin_mb) $(elf) $(elf_mb) nuclear@0: nuclear@0: .PHONY: install nuclear@0: install: $(bin) nuclear@0: if2a -n -f -W $< nuclear@0: nuclear@0: .PHONY: run nuclear@0: run: $(bin_mb) nuclear@0: if2a -m $< nuclear@0: nuclear@0: .PHONY: simrun nuclear@0: simrun: $(bin) nuclear@0: VisualBoyAdvance -T 100 -2 $(bin)