Makefile 8.95 KB
##########################################################################
#
# Makefile for RSP Fast3D 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 = 	gspFast3D.o gspFast3D.dram.o gspFast3D.fifo.o

TARGETS =	gspFast3D gspFast3D.dram gspFast3D.fifo	\
	 	gspFast3D.u.tvd gspFast3D.dram.u.tvd	\
		gspFast3D.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/Fast3D Makefile

#
# what the heck is this?
#
ig: 	gspFast3D gspFast3D.u.tvd gclip.only.u.tvd gflight.u.tvd \
	gdone.u.tvd gspFast3D.o 
	$(INSTALL) -m 555 -F /usr/lib/PR gspFast3D.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:
#
gspFast3D:	gspFast3D.u newt.u gclip.only.u gflight.u gdone.u gboot.u
	${BUILDTASK} -f 1 -o $@ -s 34 -p gboot.u gspFast3D.u -l 34 gspFast3D.u gclip.only.u gflight.u gdone.u
	dd if=$@.dat of=tmp1.dat bs=1 count=2048
	mv tmp1.dat $@.dat

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

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

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

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

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


#
# the 3D polygon ucode with output back to DRAM:
#
gspFast3D.dram:	gspFast3D.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 gspFast3D.dram.u -l 34 gspFast3D.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

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

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

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

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

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


#
# the 3D polygon ucode with output to circular DRAM fifo:
#
gspFast3D.fifo:	gspFast3D.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 gspFast3D.fifo.u -l 34 gspFast3D.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

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

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

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

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

gdone.fifo.u.tvd:	gspFast3D.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:	gspFast3D.u ../newt.s ${GFX_INCL}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DNEWT_ALONE -S gspFast3D.u -o $@ ../newt.s

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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