Makefile 9.45 KB
##########################################################################
#
# Makefile for RSP F3DNoNear graphics microcode
#
##########################################################################

PRDEPTH=../../../
include $(ROOT)/usr/include/make/PRdefs

# local defs
LCDEFS = $(HW_FLAGS) -DFAST3D

# local includes
LCINCS = -I. -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR

LDIRT  = *.dat *.lst *.sym *.dbg *.elf *.tvd			\
		gfillnops.s gfillnops.dram.s gfillnops.fifo.s

GFX_INCL = 	../gdmem.h ../gfx_regs.h

#
# this microcode uses all "common" microcode:
#
GFX_CODE = 	../gmain.s ../gyield.s ../gdma.s ../gimm.s	\
		 ../grdp.s ../gdone.s ../gmtx.s ../gvtx.s 	\
		../gsetup.s ../gclip.s ../gflight.s	\
		../newt.s ../goverlays.s ../goutxbus.s		\
		../goutdram.s ../goutfifo.s ../ginit.s		\
		../gsetup1.s ../gboot.s

INST_LIB_TARGETS = 	gspF3DNoN.o gspF3DNoN.dram.o \
			gspF3DNoN.fifo.o

TARGETS =	gspF3DNoN gspF3DNoN.dram gspF3DNoN.fifo \
	 	gspF3DNoN.u.tvd gspF3DNoN.dram.u.tvd	\
		gspF3DNoN.fifo.u.tvd			\
		gclip.only.u.tvd gclip.only.dram.u.tvd	\
		gclip.only.fifo.u.tvd			\
		gflight.u.tvd gflight.dram.u.tvd	\
		gflight.fifo.u.tvd			\
		gdone.u.tvd gdone.dram.u.tvd		\
		gdone.fifo.u.tvd			\
		${INST_LIB_TARGETS}

default: ${TARGETS} checksize

install exports: ${TARGETS} checksize
	$(INSTALL) -m 555 -F /usr/lib/PR $(INST_LIB_TARGETS)
	$(INSTALL) -m 555 -F /usr/src/PR/rspcode/graphics/F3DNoN Makefile

#
# what the heck is this?
#
ig: 	gspF3DNoN gspF3DNoN.u.tvd gclip.only.u.tvd gflight.u.tvd \
	gdone.u.tvd gspF3DNoN.o 
	$(INSTALL) -m 555 -F /usr/lib/PR gspF3DNoN.o

include $(ROOT)/usr/include/make/commonrules

##########################################################################
#
# use the RSP linker 'buildtask' to construct the tasks from the objects.
# use the rsp2elf program to construct the debug executables and library
# executables.
#
# 'dd' is used to chop the data section to the minimum required, in
# order to save ROM/RAM space.
#

#
# the regular 3D polygon ucode:
#
gspF3DNoN:	gspF3DNoN.u newt.u gclip.only.u gflight.u \
			gdone.u gboot.u
	${BUILDTASK} -f 1 -o $@ -s 34 -p gboot.u gspF3DNoN.u -l 34 \
			gspF3DNoN.u gclip.only.u gflight.u gdone.u
	dd if=$@.dat of=tmp1.dat bs=1 count=2048
	mv tmp1.dat $@.dat

gspF3DNoN.o:	gspF3DNoN
	${RSP2ELF} -p -r $?

gspF3DNoN.u.tvd:	gspF3DNoN
	${RSP2ELF} -p gspF3DNoN.u

gclip.only.u.tvd:	gspF3DNoN
	${RSP2ELF} -p gclip.only.u

gflight.u.tvd:	gspF3DNoN
	${RSP2ELF} -p gflight.u

gdone.u.tvd:	gspF3DNoN
	${RSP2ELF} -p gdone.u


#
# the 3D polygon ucode with output back to DRAM:
#
gspF3DNoN.dram:	gspF3DNoN.dram.u newt.u gclip.only.dram.u \
			gflight.dram.u gdone.dram.u gboot.dram.u
	${BUILDTASK} -f 1 -o $@ -s 34 -p gboot.dram.u gspF3DNoN.dram.u \
			-l 34 gspF3DNoN.dram.u gclip.only.dram.u \
			gflight.dram.u gdone.dram.u
	dd if=$@.dat of=tmp2.dat bs=1 count=2048
	mv tmp2.dat $@.dat

gspF3DNoN.dram.o:	gspF3DNoN.dram
	${RSP2ELF} -p -r $?

gspF3DNoN.dram.u.tvd:	gspF3DNoN.dram
	${RSP2ELF} -p gspF3DNoN.dram.u

gclip.only.dram.u.tvd:	gspF3DNoN.dram
	${RSP2ELF} -p gclip.only.dram.u

gflight.dram.u.tvd:	gspF3DNoN.dram
	${RSP2ELF} -p gflight.dram.u

gdone.dram.u.tvd:	gspF3DNoN.dram
	${RSP2ELF} -p gdone.dram.u


#
# the 3D polygon ucode with output to circular DRAM fifo:
#
gspF3DNoN.fifo:	gspF3DNoN.fifo.u newt.u gclip.only.fifo.u \
			gflight.fifo.u gdone.fifo.u gboot.fifo.u
	${BUILDTASK} -f 1 -o $@ -s 34 -p gboot.fifo.u gspF3DNoN.fifo.u \
			-l 34 gspF3DNoN.fifo.u gclip.only.fifo.u \
			gflight.fifo.u gdone.fifo.u
	dd if=$@.dat of=tmp3.dat bs=1 count=2048
	mv tmp3.dat $@.dat

gspF3DNoN.fifo.o:	gspF3DNoN.fifo
	${RSP2ELF} -p -r $?

gspF3DNoN.fifo.u.tvd:	gspF3DNoN.fifo
	${RSP2ELF} -p gspF3DNoN.fifo.u

gclip.only.fifo.u.tvd:	gspF3DNoN.fifo
	${RSP2ELF} -p gclip.only.fifo.u

gflight.fifo.u.tvd:	gspF3DNoN.fifo
	${RSP2ELF} -p gflight.fifo.u

gdone.fifo.u.tvd:	gspF3DNoN.fifo
	${RSP2ELF} -p gdone.fifo.u

#
# Ensure IMEM size does not overflow
#
checksize:	${INST_LIB_TARGETS}
	../sizecheck ${INST_LIB_TARGETS}
	../labeltest


#############################################################################
#
# build the individual objects.
#

newt.u:	gspF3DNoN.u ../newt.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DNEWT_ALONE -S gspF3DNoN.u \
			-o $@ ../newt.s

gspF3DNoN.u: gclip.only_tmp.u gflight.u ../fillnops \
			gspF3DNoN_tmp.u ${GFX_INCL} ${GFX_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	../fillnops gclip.only_tmp.u.dbg clipKill gspF3DNoN_tmp.u.dbg \
			clipAndSetup 1 > gfillnops.s
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNEAR_CLIP_OFF -o $@ \
			-S gclip.only_tmp.u ../gmain.s
	@echo " "

gspF3DNoN.dram.u: gclip.only_tmp.dram.u gflight.dram.u ../fillnops \
			gspF3DNoN_tmp.dram.u ${GFX_INCL} ${GFX_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	../fillnops gclip.only_tmp.dram.u.dbg clipKill \
			gspF3DNoN_tmp.dram.u.dbg clipAndSetup 1 > \
			gfillnops.dram.s
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNEAR_CLIP_OFF \
			-DOUTPUT_DRAM -o $@ -S gclip.only_tmp.dram.u ../gmain.s
	@echo " "

gspF3DNoN.fifo.u: gclip.only_tmp.fifo.u gflight.fifo.u ../fillnops \
			gspF3DNoN_tmp.fifo.u ${GFX_INCL} ${GFX_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	../fillnops gclip.only_tmp.fifo.u.dbg clipKill \
			gspF3DNoN_tmp.fifo.u.dbg clipAndSetup 1 > \
			gfillnops.fifo.s
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNEAR_CLIP_OFF \
			-DOUTPUT_FIFO -o $@ -S gclip.only_tmp.fifo.u ../gmain.s
	@echo " "

gboot.u: gspF3DNoN.u ../gboot.s
	${RSPASM} ${LCINCS} ${LCDEFS} -o $@ -S gspF3DNoN.u ../gboot.s

gboot.dram.u: gspF3DNoN.dram.u ../gboot.s
	${RSPASM} ${LCINCS} ${LCDEFS} -o $@ -S gspF3DNoN.dram.u ../gboot.s

gboot.fifo.u: gspF3DNoN.fifo.u ../gboot.s
	${RSPASM} ${LCINCS} ${LCDEFS} -o $@ -S gspF3DNoN.fifo.u ../gboot.s

gspF3DNoN_tmp.u:	${GFX_INCL} ${GFX_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNEAR_CLIP_OFF -DNODATA \
			-o $@ ../gmain.s
	@echo " "

gspF3DNoN_tmp.dram.u:	${GFX_INCL} ${GFX_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNODATA -DNEAR_CLIP_OFF \
			-DOUTPUT_DRAM -o $@ ../gmain.s
	@echo " "

gspF3DNoN_tmp.fifo.u:	${GFX_INCL} ${GFX_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNODATA -DNEAR_CLIP_OFF \
			-DOUTPUT_FIFO -o $@ ../gmain.s
	@echo " "

gclip.only_tmp.u:	gspF3DNoN_tmp.u ../goverlays.s ../gclip.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DCLIP_ALONE -DPRECISE_CLIP -DNODATA \
			-DNEAR_CLIP_OFF -o $@ -S gspF3DNoN_tmp.u ../goverlays.s

gclip.only_tmp.dram.u:	gspF3DNoN_tmp.dram.u ../goverlays.s ../gclip.s \
			${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DCLIP_ALONE -DPRECISE_CLIP -DNODATA \
			-DNEAR_CLIP_OFF -DOUTPUT_DRAM -o $@ -S \
			gspF3DNoN_tmp.dram.u ../goverlays.s

gclip.only_tmp.fifo.u:	gspF3DNoN_tmp.fifo.u ../goverlays.s ../gclip.s \
			${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DCLIP_ALONE -DPRECISE_CLIP -DNODATA \
			-DNEAR_CLIP_OFF -DOUTPUT_FIFO -o $@ -S \
			gspF3DNoN_tmp.fifo.u ../goverlays.s

gclip.only.u:		gspF3DNoN.u ../goverlays.s ../gclip.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DCLIP_ALONE -DPRECISE_CLIP -DNODATA \
			-DNEAR_CLIP_OFF -o $@ -S gspF3DNoN.u ../goverlays.s

gclip.only.dram.u:	gspF3DNoN.dram.u ../goverlays.s ../gclip.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DCLIP_ALONE -DPRECISE_CLIP -DNODATA \
			-DNEAR_CLIP_OFF -DOUTPUT_DRAM -o $@ -S \
			gspF3DNoN.dram.u ../goverlays.s

gclip.only.fifo.u:	gspF3DNoN.fifo.u ../goverlays.s ../gclip.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DCLIP_ALONE -DPRECISE_CLIP -DNODATA \
			-DNEAR_CLIP_OFF -DOUTPUT_FIFO -o $@ -S \
			gspF3DNoN.fifo.u ../goverlays.s

gflight.u:		gspF3DNoN_tmp.u ../gflight.s ../goverlays.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFLIGHT -DNODATA -DNEAR_CLIP_OFF -o $@ -S \
			gspF3DNoN_tmp.u ../goverlays.s

gflight.dram.u:		gspF3DNoN_tmp.dram.u ../gflight.s ../goverlays.s \
			${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFLIGHT -DNODATA -DNEAR_CLIP_OFF \
			-DOUTPUT_DRAM -o $@ -S gspF3DNoN_tmp.dram.u \
			../goverlays.s

gflight.fifo.u:		gspF3DNoN_tmp.fifo.u ../gflight.s ../goverlays.s \
			${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFLIGHT -DNODATA -DNEAR_CLIP_OFF \
			-DOUTPUT_FIFO -o $@ -S gspF3DNoN_tmp.fifo.u ../goverlays.s

gdone.u:		gspF3DNoN_tmp.u ../gdone.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNODATA -DNEAR_CLIP_OFF -o $@ \
			-S gspF3DNoN_tmp.u ../gdone.s

gdone.dram.u:		gspF3DNoN_tmp.dram.u ../gdone.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNODATA -DNEAR_CLIP_OFF \
			-DOUTPUT_DRAM -o $@ -S gspF3DNoN_tmp.dram.u ../gdone.s

gdone.fifo.u:		gspF3DNoN_tmp.fifo.u ../gdone.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNODATA -DNEAR_CLIP_OFF \
			-DOUTPUT_FIFO -o $@ -S gspF3DNoN_tmp.fifo.u ../gdone.s

# DO NOT DELETE THIS LINE -- make depend depends on it.