Makefile 2.76 KB
##########################################################################
#
# Makefile for Manufacturing Test Vectors microcode
#
##########################################################################

PRDEPTH=../../
include $(PRDEPTH)/PRdefs

OPTIMIZER = -g

# local defs
LCDEFS = $(HW_FLAGS) 

# uncomment this to show the bow-tie polygons...
# local includes
LCINCS = -I. -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR
LDOPTS = -L. -L$(ROOT)/usr/lib/PR
LDLIBS = -ll -lm

LDIRT  = *.dat *.lst *.sym *.dbg *.elf *.tvd tdmem_init.h tdmem_label.h \
		sortdata

TST_INCL = 	tdmem_label.h tdmem_init.h tst_regs.h

TST_CODE = 	tmain.s tdma.s timm.s trdp.s tdone.s	\
		toutxbus.s toutdram.s tinit.s tbl.s

INST_TOOL_TARGETS = 

INST_LIB_TARGETS = 	tspManTest1.o tspManTest1.dram.o

TARGETS = 	tspManTest1 tspManTest1.dram 		\
	 	tspManTest1.u.tvd tspManTest1.dram.u.tvd	\
		${INST_LIB_TARGETS}			\
		${INST_TOOL_TARGETS}

default: ${TARGETS} checksize

install exports: ${TARGETS} checksize
	./labeltest
	$(INSTALL) -m 555 -F /usr/lib/PR $(INST_LIB_TARGETS)
#	$(INSTALL) -m 555 -F /usr/sbin $(INST_TOOL_TARGETS)

include $(PRDEPTH)/PRrules

##########################################################################
#
# use the RSP linker 'buildtask' to construct the tasks from the objects.
# use the rsp2elf program to construct the debug executables and library
# executables.
#

#
# the regular 3D polygon ucode:
#
tspManTest1:	tspManTest1.u 
	${BUILDTASK} -f 1 -o $@ tspManTest1.u

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

tspManTest1.u.tvd:	tspManTest1
#	uniquelabel tspManTest1.u.dbg
	${RSP2ELF} -p tspManTest1.u

#
# the 3D polygon ucode with output back to DRAM:
#
tspManTest1.dram:	tspManTest1.dram.u 
	${BUILDTASK} -f 1 -o $@ tspManTest1.dram.u 

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

tspManTest1.dram.u.tvd:	tspManTest1.dram
#	uniquelabel tspManTest1.dram.u.dbg
	${RSP2ELF} -p tspManTest1.dram.u


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


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

tspManTest1.u: ${TST_INCL} ${TST_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -o $@ tmain.s
	@echo " "

tspManTest1.dram.u: ${TST_INCL} ${TST_CODE}
	@echo "****"
	@echo "**** Building $@:"
	@echo "****"
	${RSPASM} ${LCINCS} ${LCDEFS} -DOUTPUT_DRAM -o $@ tmain.s
	@echo " "

sortdata: sortdata.c
	$(CC) -o sortdata sortdata.c

tdmem_label.h tdmem_init.h: tdmem.h sortdata
	sortdata -l < tdmem.h > tdmem_label.h
	sortdata -i < tdmem.h > tdmem_init.h

##############################################################################
#
# utility (tool) programs...
#


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