Makefile 2.52 KB
##########################################################################
#
# Makefile for RSP turbo graphics microcode
#
##########################################################################

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

# local defs
LCDEFS = $(HW_FLAGS) -DTURBO3D

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

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

#
# this is the subset of the "common" code that we use here:
#
COMMON_GFX_CODE =	../gfx_regs.h ../gyield.s ../gdone.s		\
			../ginit.s ../gboot.s ../newt.s ../goutxbus.s	\
			../goutdram.s ../goutfifo.s

TURBO_CODE =	gtdmem.h gtmain.s gtinit.s gtstate.s gtvtx.s gtsetup.s 

INST_LIB_TARGETS = 	gspTurbo3D.o gspTurbo3D.dram.o gspTurbo3D.fifo.o

TARGETS = 	gspTurbo3D gspTurbo3D.dram gspTurbo3D.fifo ${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/Turbo3D Makefile $(TURBO_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 Turbo 3D polygon ucode: (fast with greatly reduced features)
#
gspTurbo3D:	${COMMON_GFX_CODE} ${TURBO_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -o $@ gtmain.s
	@echo " "

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

gspTurbo3D.tvd:	gspTurbo3D
	${RSP2ELF} -p gspTurbo3D

#
# .dram version
#
gspTurbo3D.dram:	${COMMON_GFX_CODE} ${TURBO_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DOUTPUT_DRAM -o $@ gtmain.s
	@echo " "

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

gspTurbo3D.dram.tvd:	gspTurbo3D.dram
	${RSP2ELF} -p gspTurbo3D.dram

#
# .fifo version
#
gspTurbo3D.fifo:	${COMMON_GFX_CODE} ${TURBO_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DOUTPUT_FIFO -o $@ gtmain.s
	@echo " "

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

gspTurbo3D.fifo.tvd:	gspTurbo3D.fifo
	${RSP2ELF} -p gspTurbo3D.fifo

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

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