TARGET = adhoc
OBJS = main.o luaplayer.o

# Define to build this as a prx (instead of a static elf)
BUILD_PRX=1
# Define the name of our custom exports (minus the .exp extension)
PRX_EXPORTS=exports.exp

USE_NEWLIB_LIBC = 1

INCDIR = -I ..  
CFLAGS = -O2 -G0 -Wall -mno-explicit-relocs $(shell freetype-config --cflags)
CXXFLAGS = $(CFLAGS) -mno-explicit-relocs -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBS = -lc -llua -llualib -lpng -ljpeg -lz -lpspgum -lm -lmikmod -lmmio $(shell freetype-config --libs) \
	-lpsprtc -lpspaudiolib -lpspaudio -lpspusb -lpspusbstor -lpsppower \
	-lpspwlan -lpspgu -lpspdebug -lpsphprm_driver -lpspumd -lmad -lz \
	-lpspnet_adhoc -lpspnet_adhocctl -lpspnet_adhocmatching -lpspnet_inet 
LIBDIR =

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


EXTRA_CLEAN = luaplayer.S exports.o adhoc.elf adhoc.lrx

release: all
	cp adhoc.prx ../adhoc.lrx

luaplayer.S: ../../src/exports.exp
	$(shell psp-config --pspdev-path)/bin/psp-build-exports --build-stubs $<

