######################################################################
#
# GLOVER PS MAKEFILE
#
######################################################################

#
# MACROS
#

#OPT =  -xc++ -wall -DWHACK -c -O0 -g -X0$18000
#OPT =  -comments-c++ -Wall -DWHACK -c -O0 -g -mgpopt -G16 -X0$18000
OPT =  -comments-c++ -DWHACK -c -O0 -g -mgpopt -G16 -X0$18000

GPSX = x:\ateam\psx-glover99

#
# DEFAULT BUILD RULES
#

.c.obj:							 
        ccpsx32 $(OPT) $&.c -o$&.obj
		dmpsx -b $&.obj


#
# MAIN TARGET
#			   

whack.cpe:	main.obj convert.obj collide.obj object.obj poly.obj lscape.obj quatern.obj texture.obj \
			memory.obj utils.obj files.obj interupt.obj \
			ctrller.obj maths.obj	incbins.obj	\
			camera.obj overlay.obj font.obj	viewer.obj glovctrl.obj	effects.obj sound.obj 
#			andy.obj  lights.obj 
			psylink /l ..\..\lib.43 /n500 /m /c /g @glover.lnk,glover.cpe,glover.sym
#			symmunge glover.sym


#
# SECONDARY TARGET - download and run
#

run: whack.cpe
	resetps /p
	run whack.cpe
	testmess

#
# SECONDARY TARGET - download and debug
#
debug: whack.cpe
	resetps /p
        dbugpsx whack /e

# BUILD ALL TEXTURE BANKS & FONTS
# doschop -u -f<OUTNAME.SPT> *.bmp
textures:
		cd \psx\whack\glovsrc\worlds\generic\textures\menu
		doschop -u -f\psx\whack\cd\worlds\generic\menu.spt		*.bmp

		cd \psx\whack\glovsrc\worlds\generic\textures\generic
		doschop -u -f\psx\whack\cd\worlds\generic\generic.spt	*.bmp

		cd \psx\whack\glovsrc\worlds\atlantis\textures
		doschop -u -f\psx\whack\cd\worlds\atlantis\atlantis.spt	*.bmp

		cd \psx\whack\glovsrc\worlds\carnival\textures
		doschop -u -f\psx\whack\cd\worlds\carnival\carnival.spt	*.bmp

		cd \psx\whack\glovsrc\worlds\prehist\textures
		doschop -u -f\psx\whack\cd\worlds\prehist\prehist.spt	*.bmp

		cd \psx\whack\glovsrc\worlds\pirates\textures
		doschop -u -f\psx\whack\cd\worlds\pirates\pirates.spt	*.bmp
 
		cd \psx\whack\glovsrc\worlds\fortress\textures
		doschop -u -f\psx\whack\cd\worlds\fortress\fortress.spt	*.bmp

		cd \psx\whack\glovsrc\worlds\ootw\textures
		doschop -u -f\psx\whack\cd\worlds\ootw\ootw.spt			*.bmp

# skies
		cd \psx\whack\glovsrc\worlds\generic\textures\skies\cloudsky
		doschop -u -f\psx\whack\cd\graphics\cloudsky.spt		*.bmp

		cd \psx\whack\glovsrc\worlds\generic\textures\skies\darksky
		doschop -u -f\psx\whack\cd\graphics\darksky.spt			*.bmp

		cd \psx\whack\glovsrc\worlds\generic\textures\skies\nightsky
		doschop -u -f\psx\whack\cd\graphics\nightsky.spt		*.bmp

		cd \psx\whack\glovsrc\worlds\generic\textures\skies\sunset
		doschop -u -f\psx\whack\cd\graphics\sunset.spt			*.bmp
				

# fonts
		cd \psx\whack\glovsrc\worlds\generic\fonts\newfont
		doschop -u -c -f\psx\whack\cd\graphics\newfont.spt		*.bmp

		cd \psx\whack\glovsrc\worlds\generic\fonts\font
		doschop -u -f\psx\whack\cd\graphics\font45.spt			fnt45*.bmp

		cd \psx\whack\glovsrc\worlds\generic\fonts\font
		doschop -u -f\psx\whack\cd\graphics\font88.spt			fnt88*.bmp


# BUILD WORLD MESHES
meshes:
		cd $(GPSX)\worlds\atlantis\level1\gfxmesh
		slicer at1gfxmesh2.psa $(GPSX)\cd\worlds\atlantis\l1\at1.wld


# BUILD COLLISION MESHES
coll:
		cd $(GPSX)\worlds\atlantis\level1\collmesh
		collconv at1coll.x $(GPSX)\cd\worlds\atlantis\l1\at1.raw


# BUILD ALL LEVELS
worlds:
		scripted worlds\hub\hub1.lnd			..\cd\worlds\hub\hub1.lev -psx			-rworlds\hub\hub1.txt
		scripted worlds\hub\hub2.lnd			..\cd\worlds\hub\hub2.lev -psx			-rworlds\hub\hub2.txt
		scripted worlds\hub\hub3.lnd	 		..\cd\worlds\hub\hub3.lev -psx			-rworlds\hub\hub3.txt
		scripted worlds\hub\hub4.lnd	 		..\cd\worlds\hub\hub4.lev -psx			-rworlds\hub\hub4.txt
		scripted worlds\hub\hub5.lnd	 		..\cd\worlds\hub\hub5.lev -psx			-rworlds\hub\hub5.txt
		scripted worlds\hub\hub6.lnd			..\cd\worlds\hub\hub6.lev -psx			-rworlds\hub\hub6.txt
		scripted worlds\hub\hub7.lnd			..\cd\worlds\hub\hub7.lev -psx			-rworlds\hub\hub7.txt
		scripted worlds\hub\hub8.lnd			..\cd\worlds\hub\hub8.lev -psx			-rworlds\hub\hub8.txt
		scripted worlds\hub\cave.lnd			..\cd\worlds\hub\cave.lev -psx 			-rworlds\hub\cave.txt		
		scripted worlds\hub\acourse.lnd			..\cd\worlds\hub\acourse.lev -psx		-rworlds\hub\acourse.txt		
		scripted worlds\atlantis\at1.lnd		..\cd\worlds\atlantis\at1.lev -psx		-rworlds\atlantis\at1.txt	
		scripted worlds\atlantis\at2.lnd		..\cd\worlds\atlantis\at2.lev -psx		-rworlds\atlantis\at2.txt	
		scripted worlds\atlantis\at3a.lnd		..\cd\worlds\atlantis\at3a.lev -psx		-rworlds\atlantis\at3a.txt	
		scripted worlds\atlantis\atboss.lnd		..\cd\worlds\atlantis\atboss.lev -psx	-rworlds\atlantis\atboss.txt	
		scripted worlds\atlantis\atbonus.lnd	..\cd\worlds\atlantis\atbonus.lev -psx	-rworlds\atlantis\atbonus.txt
		scripted worlds\carnival\ck1.lnd		..\cd\worlds\carnival\ck1.lev -psx		-rworlds\carnival\ck1.txt	
		scripted worlds\carnival\ck2a.lnd		..\cd\worlds\carnival\ck2a.lev -psx		-rworlds\carnival\ck2a.txt	
		scripted worlds\carnival\ck3a.lnd		..\cd\worlds\carnival\ck3a.lev -psx		-rworlds\carnival\ck3a.txt	
		scripted worlds\carnival\ckboss.lnd		..\cd\worlds\carnival\ckboss.lev -psx	-rworlds\carnival\ckboss.txt	
		scripted worlds\carnival\ckbonus.lnd	..\cd\worlds\carnival\ckbonus.lev -psx	-rworlds\carnival\ckbonus.txt
		scripted worlds\pirates\pc1.lnd			..\cd\worlds\pirates\pc1.lev -psx		-rworlds\pirates\pc1.txt		
		scripted worlds\pirates\pc2a.lnd		..\cd\worlds\pirates\pc2a.lev -psx		-rworlds\pirates\pc2a.txt	
		scripted worlds\pirates\pc3b.lnd		..\cd\worlds\pirates\pc3b.lev -psx		-rworlds\pirates\pc3b.txt	
		scripted worlds\pirates\pcboss.lnd		..\cd\worlds\pirates\pcboss.lev -psx		-rworlds\pirates\pcboss.txt	
		scripted worlds\pirates\pcbonus.lnd		..\cd\worlds\pirates\pcbonus.lev -psx	-rworlds\pirates\pcbonus.txt	
		scripted worlds\prehist\ph1a.lnd		..\cd\worlds\prehist\ph1a.lev -psx		-rworlds\prehist\ph1a.txt	
		scripted worlds\prehist\ph2a.lnd		..\cd\worlds\prehist\ph2a.lev -psx		-rworlds\prehist\ph2a.txt	
		scripted worlds\prehist\ph3b.lnd		..\cd\worlds\prehist\ph3b.lev -psx		-rworlds\prehist\ph3b.txt	
		scripted worlds\prehist\phboss.lnd		..\cd\worlds\prehist\phboss.lev -psx		-rworlds\prehist\phboss.txt	
		scripted worlds\prehist\phbonus.lnd		..\cd\worlds\prehist\phbonus.lev -psx	-rworlds\prehist\phbonus.txt	
		scripted worlds\fortress\ff1a.lnd		..\cd\worlds\fortress\ff1a.lev -psx		-rworlds\fortress\ff1a.txt	
		scripted worlds\fortress\ff2a.lnd		..\cd\worlds\fortress\ff2a.lev -psx		-rworlds\fortress\ff2a.txt	
		scripted worlds\fortress\ff3b.lnd		..\cd\worlds\fortress\ff3b.lev -psx		-rworlds\fortress\ff3b.txt	
		scripted worlds\fortress\ffboss.lnd		..\cd\worlds\fortress\ffboss.lev -psx	-rworlds\fortress\ffboss.txt	
		scripted worlds\fortress\ffbonus.lnd	..\cd\worlds\fortress\ffbonus.lev -psx	-rworlds\fortress\ffbonus.txt
		scripted worlds\ootw\ow2a.lnd			..\cd\worlds\ootw\ow2a.lev -psx			-rworlds\ootw\ow2a.txt		
		scripted worlds\ootw\ow2b.lnd			..\cd\worlds\ootw\ow2b.lev -psx			-rworlds\ootw\ow2b.txt		
		scripted worlds\ootw\ow3.lnd			..\cd\worlds\ootw\ow3.lev -psx			-rworlds\ootw\ow3.txt		
		scripted worlds\ootw\owboss1.lnd		..\cd\worlds\ootw\owboss1.lev -psx		-rworlds\ootw\owboss1.txt	
		scripted worlds\ootw\tween.lnd			..\cd\worlds\ootw\tween.lev -psx			-rworlds\ootw\tween.txt		
		scripted worlds\ootw\owboss3.lnd		..\cd\worlds\ootw\owboss3.lev -psx		-rworlds\ootw\owboss3.txt	
		scripted worlds\ootw\owbonus.lnd		..\cd\worlds\ootw\owbonus.lev -psx		-rworlds\ootw\owbonus.txt	
		scripted worlds\hub\wayroom.lnd			..\cd\worlds\hub\wayroom.lev -psx		-rworlds\hub\wayroom.txt		
		scripted worlds\hub\present.lnd			..\cd\worlds\hub\present.lev -psx		-rworlds\hub\present.txt		
		scripted worlds\hub\flythru.lnd			..\cd\worlds\hub\flythru.lev -psx		-rworlds\hub\flythru.txt		
		scripted worlds\hub\flythru2.lnd		..\cd\worlds\hub\flythru2.lev -psx		-rworlds\hub\flythru2.txt	
		scripted worlds\hub\intro.lnd			..\cd\worlds\hub\intro.lev -psx			-rworlds\hub\intro.txt		
		scripted worlds\hub\outro.lnd			..\cd\worlds\hub\outro.lev -psx			-rworlds\hub\outro.txt		


#
# GAME COMPONENTS
#

incbins.obj:	incbins.s
	asmpsx /zd /l incbins.s,incbins.obj


