TARGET = c:/gpsnes9x
BINDIR =
INCDIRS = -I . -I snes9x \
	  
STRIP = -s
LIBS = $(STRIP) -lm -lsupc++
export CCBASE=c:/devkitadv
export CUSER=-DLITTLE_ENDIAN -D__GCC__ -D__GP32__ -DFRAMESKIP $(INCDIRS) -fexceptions

include $(CCBASE)/gp32.mk.nest

%.o : %.rc
	$(WRES) $(CPPFLAGS) $< $@

OBJS=gpmain.o gpsnes9x.o xlatgpsnes9x.o \
	snes9x/2XSAI.o snes9x/APU.o snes9x/APUDEBUG.o snes9x/c4.o snes9x/c4emu.o\
	snes9x/CHEATS.o snes9x/cheats2.o snes9x/CLIP.o snes9x/CPU.o snes9x/CPUEXEC.o\
	snes9x/CPUOPS.o snes9x/data.o snes9x/DEBUG.o snes9x/DMA.o snes9x/DSP1.o\
	snes9x/fxdbg.o snes9x/fxemu.o snes9x/fxinst.o snes9x/GFX.o snes9x/GLOBALS.o\
	snes9x/LOADZIP.o snes9x/MEMMAP.o snes9x/NETPLAY.o snes9x/PPU.o snes9x/sa1.o\
	snes9x/SA1CPU.o snes9x/SDD1.o snes9x/snaporig.o snes9x/SNAPSHOT.o\
	snes9x/SNES9X.o snes9x/SOUNDUX.o snes9x/SPC700.o snes9x/srtc.o\
	snes9x/TILE.o
	

all: $(TARGET).gxb

cleanobjs:
	rm -f $(OBJS)

cleanbin:
	rm -f $(TARGET).gxb
	rm -f $(TARGET).elf

clean:	cleanobjs cleanbin

$(TARGET).gxb: $(TARGET).elf
$(TARGET).elf: $(OBJS)
	$(LINK)