all:
	$(MAKE) -C remotejoy all
	psp-build-exports -s -k -v remotejoy/exports.exp
	cp remotejoy.S cfe_vsh
	mv remotejoy.S cfe_game
	$(MAKE) -C cfe_ftpd all
	$(MAKE) -C cfe_game all
	$(MAKE) -C cfe_vsh all
	psp-build-exports -s -k -v cfe_vsh/exports.exp
	mv cfeVsh.S cfe_music
	psp-build-exports -s -k -v cfe_game/exports.exp
	mv cfeGame.S cfe_music
	$(MAKE) -C cfe_music all
	$(MAKE) -C usbhostfs all PSP_FW_VERSION=271

release: all
	mkdir -p release/seplugins/cfe
	mkdir -p release/TM/150_340/kd
	cp cfe_game/cfe_game.prx release/seplugins/cfe
	cp cfe_game/game.txt release/seplugins
	cp cfe_game/pops.txt release/seplugins
	cp cfe_vsh/cfe_vsh.prx release/seplugins/cfe
	cp cfe_vsh/vsh.txt release/seplugins
	cp cfe_music/cfe_music.prx release/seplugins/cfe
	cp cfe_ftpd/cfe_ftpd.prx release/seplugins/cfe
	cp cfe.config release/seplugins/cfe
	cp remotejoy/remotejoy.prx release/seplugins/cfe
	cp usbhostfs/usbhostfs.prx release/seplugins/cfe
	cp TM/150_340/kd/* release/TM/150_340/kd
	cp cfe_game/cfe_game.prx release/TM/150_340/
	cp cfe_vsh/cfe_vsh.prx release/TM/150_340/

clean:
	$(MAKE) -C cfe_ftpd clean
	$(MAKE) -C cfe_game clean
	$(MAKE) -C cfe_vsh clean
	$(MAKE) -C remotejoy clean	
	$(MAKE) -C usbhostfs clean
	$(MAKE) -C cfe_music clean
	rm -rf release
