CC = /mnt/scratch/gba/bin/arm-thumb-elf-gcc
OBJCOPY = /mnt/scratch/gba/bin/arm-thumb-elf-objcopy
AR = /mnt/scratch/gba/bin/arm-thumb-elf-ar
CFLAGS = -Wall -marm -mapcs-32 -mcpu=arm7tdmi

tremor_example.gba: main.c libtremor/libtremor.a Makefile
	#
	# Building tremor_example.gba
	#
	${CC} main.c song.o libtremor/libtremor.a -o tremor_example.elf -T lnkscript -Wall ${CFLAGS}
	${OBJCOPY} -O binary tremor_example.elf tremor_example.gba
	# GBA Image

tremor_example.mb: main.c libtremor/libtremor.a Makefile
	#
	# Building tremor_example.mb (Multiboot)
	#
	${CC} main.c song.o libtremor/libtremor.a -o tremor_example.elf -T lnkscript -DMULTIBOOT ${CFLAGS}
	${OBJCOPY} -O binary tremor_example.elf tremor_example.mb
	# MB Image

all: tremor_example.mb tremor_example.gba

clean:
	rm -f *~ tremor_example.elf tremor_example.mb tremor_example.gba
