gba/Makefile

41 lines
696 B
Makefile

PATH := $(DEVKITARM)/bin:$(DEVKITPRO)/tools/bin:$(PATH)
PROJ := first
TARGET := $(PROJ)
PREFIX := arm-none-eabi-
CC := $(PREFIX)gcc
OBJCOPY := $(PREFIX)objcopy
OBJDUMP := $(PREFIX)objdump
FIX := gbafix
ARCH := -mthumb-interwork -mthumb
SPECS := -specs=gba.specs
SOURCES := first.S charset.S
.PHONY : build clean
build: $(TARGET).gba
debug: $(TARGET).elf $(TARGET).debug.elf
first.dump: first.elf
$(OBJDUMP) -d $<
first.gba: first.unfixed.gba
gbafix -p -d1 $<
first.unfixed.gba: first.elf
$(OBJCOPY) -v -O binary $< $@
first.debug.elf: $(SOURCES)
$(CC) $(ARCH) $(SPECS) -g -o $@ $^
first.elf: $(SOURCES)
$(CC) $(ARCH) $(SPECS) -o $@ $^
clean:
rm *.gba
rm *.elf