 #
 #  File: Makefile
 #  Project: 212SP08 Assignment 2
 #  Description: the makefile
 #

PROJ= Mario
CC= arm-eabi-g++
OBJCOPY= arm-eabi-objcopy
PROJFILES = defs.o graphics.o map.o util.o sprite.o background.o game.o

.cpp.o: 
	$(CC) -c $<



.PHONY : build
build : $(PROJFILES)
	$(CC) -specs=gba.specs -g  $(PROJFILES) -o $(PROJ).elf
	$(OBJCOPY) -v -O binary $(PROJ).elf $(PROJ).gba
	gbafix $(PROJ).gba

.PHONY : clean

clean :
	@rm -fv *.o
	@rm -fv *.elf
	@rm -fv *.gba
