include $(ROOT)/usr/include/make/GBAdefs

TARGETS = pong.bwf pong.mrg

ASFILES = crt0.s
CFILES  = main.c data.c
HEADERS = data.h

default: $(TARGETS)

LLDOPTS += -Ttext 0x08000000 -Tbss 0x03000000 -T $(GBA_LINK) \
           -L$(ROOT)/usr/lib/gba -L$(ROOT)/import/usr/lib/gba \
           -L$(ROOT)/usr/lib/sc
LLDLIBS += -lagbsyscall -lisagbprn -lvng -lvoice -lisfs -lios -lc -lvio_usb
LCINCS += -I$(ROOT)/import/usr/include -I$(ROOT)/usr/include/sc \
          -I$(ROOT)/usr/include
LCDEFS += -DGBA

LDIRT += pong.mrg pong.elf launch.bin launch.elf launchStub.c

include $(COMMONRULES)

pong.elf: $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJECTS) $(LDLIBS)

pong.mrg: pong.elf
	$(MERGE) -g pong.elf -o pong.mrg

pong.bwf: pong.mrg
	$(PUBLISH) -n pong -l pong.mrg -m pong.meta
