#
# psp makefile generics
#

all:	subdir package-pbp
debug:	subdir-debug

#
# psp toolchain overrides
#

CC  = psp-gcc
CXX = psp-g++
AR  = psp-ar

BINEXT        = .elf
BINNAME       = ${TARGET}${BINEXT}
BINNAME_STRIP = ${TARGET}${BINEXT}.strip

# we want to do other things before the strip, so override it.
STRIP = /bin/true 

# standard libraries
LIBS += -lc -lpsppower -lvorbisidec

# additional flags
INCLUDES += -DPSP_BUILD -DUSE_TREMOR -I${PREFIX}/sdk/include

package-pbp:
	psp-fixup-imports ${BINNAME}
	mksfo 'MegaZeux PSP' PARAM.SFO
	psp-strip ${BINNAME} -o ${BINNAME_STRIP}
	pack-pbp EBOOT.PBP PARAM.SFO NULL \
		 NULL NULL NULL \
		 NULL ${BINNAME_STRIP} NULL
	rm -f ${BINNAME_STRIP}
