PSPSDK=$(shell psp-config --pspsdk-path)
PSPDIR=$(shell psp-config --psp-prefix)

TARGET_LIB = ../lib/libtri.a
OBJS = ./streams/streams.o ./triTexman.o ./triCamera.o ./triVAlloc.o ./triMemory.o  ./triFont.o \
	./triRefcount.o ./triImage.o ./rle.o ./triGraphics.o ./tri3d.o ./triLog.o \
	./triModel.o ./triInput.o ./triVMath_vfpu.o ./triAt3.o ./triWav.o ./triAudioLib.o \
	./triNet.o ./triError.o ./triLog.o
CFLAGS += -I../include -I $(PSPDIR)/include -I $(PSPDIR)/include/freetype2 -I ./streams -I ./mmgr -I ./pmp -D__PSP__ -DDEBUG -D_DEBUG -D_DEBUG_LOG -D_DEBUG_MEMORY -DTRI_SUPPORT_PNG
LIBS = -lpspgum -lpspgu -lpsprtc -lm -lz -lpspwlan -lpspaudio -lpspaudiocodec -lcurl
include $(PSPSDK)/lib/build.mak

install: $(PSP_LIB)
	@echo "Installing libtri into $(PSPDIR)"
	mkdir -p $(PSPDIR)/include $(PSPDIR)/include/tri $(PSPDIR)/include/tri/streams $(PSPDIR)/include/tri/mmgr $(PSPDIR)/include/tri/pmp  $(PSPDIR)/lib
	cp *.h $(PSPDIR)/include/tri
	cp ./streams/*.h $(PSPDIR)/include/tri/streams
	cp ./mmgr/*.h $(PSPDIR)/include/tri/mmgr
	cp ./pmp/*.h  $(PSPDIR)/include/tri/pmp
	cp $(TARGET_LIB) $(PSPDIR)/lib
	@echo "Done"
