Makefile 3.4 KB
##########################################################################
#
# Makefile for RSP line graphics microcode
#
##########################################################################

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

# local defs
LCDEFS = $(HW_FLAGS) -DLINE3D

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

LDIRT  = *.dat *.lst *.sym *.dbg *.elf *.tvd

GFX_INCL = 	gdmem.h gfx_regs.h

#
# this is the subset of the "common" graphics code we use here:
#
COMMON_GFX_CODE =	../gdmem.h ../gfx_regs.h ../gyield.s ../gdone.s	\
			../ginit.s ../gboot.s ../newt.s ../goutxbus.s	\
			../goutdram.s ../goutfifo.s			\
			../gmain.s ../gdma.s ../gimm.s ../grdp.s	\
			../gmtx.s ../gvtx.s ../gflight.s ../goverlays.s

LINE_CODE = 	gline.s gclipl.s

INST_LIB_TARGETS =	gspLine3D.o gspLine3D.dram.o gspLine3D.fifo.o

TARGETS =	gspLine3D gspLine3D.dram gspLine3D.fifo	\
		gspLine3D.tvd gspLine3D.dram.tvd	\
		gspLine3D.fifo.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/Line3D Makefile $(LINE_CODE)

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 3D line ucode:
#
gspLine3D:	gspLine3D.u newt.u
	${BUILDTASK} -f 1 -o $@ gspLine3D.u newt.u
	dd if=$@.dat of=tmp1.dat bs=1 count=2048
	mv tmp1.dat $@.dat

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

gspLine3D.tvd:	gspLine3D
	${RSP2ELF} -p $?

#
# the 3D line ucode with output back to DRAM:
#
gspLine3D.dram:	gspLine3D.dram.u newt.u
	${BUILDTASK} -f 1 -o $@ gspLine3D.dram.u newt.u
	dd if=$@.dat of=tmp2.dat bs=1 count=2048
	mv tmp2.dat $@.dat

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

gspLine3D.dram.tvd:	gspLine3D.dram
	${RSP2ELF} -p $?

#
# the 3D line ucode with output to circular DRAM fifo:
#
gspLine3D.fifo:	gspLine3D.fifo.u newt.u
	${BUILDTASK} -f 1 -o $@ gspLine3D.fifo.u newt.u
	dd if=$@.dat of=tmp3.dat bs=1 count=2048
	mv tmp3.dat $@.dat

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

gspLine3D.fifo.tvd:	gspLine3D.fifo
	${RSP2ELF} -p $?

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


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

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

gspLine3D.u:	${COMMON_GFX_CODE} ${LINE_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -o $@ ../gmain.s
	@echo " "

gspLine3D.dram.u:	${COMMON_GFX_CODE} ${LINE_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DOUTPUT_DRAM -o $@ ../gmain.s
	@echo " "

gspLine3D.fifo.u:	${COMMON_GFX_CODE} ${LINE_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DOUTPUT_FIFO -o $@ ../gmain.s
	@echo " "

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