Makefile
4.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
##########################################################################
#
# Makefile for RSP Fast3D graphics microcode
#
##########################################################################
PRDEPTH=../../../../
include $(PRDEPTH)/PRdefs
#
UCODE = gspF3DPEX
GMAIN = ../../gmain.s
# local defs
#LCDEFS = $(HW_FLAGS) -DFAST3D -DCLIP_ON -DNOFRONTREJ -DSMARTDLCOUNT -DSMARTINP
LCDEFS = $(HW_FLAGS) -DFAST3D -DSMARTDLCOUNT -DSMARTINP -DMTXNOLMT \
-DMOREDLLNK -DRETGFX1 -DF3DEX_GBI -DFASTYSORT -DSTATICQDIV \
-DBRANCH_Z -DSWITCH_UCODE -DFORCE_MMTX_LOAD
# local includes
LCINCS = -I. -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
GDIRT = *.u $(UCODE).fifo
GFX_INCL = ../../gdmem.h ../../gfx_regs.h
#
# this microcode uses all "common" microcode:
#
GFX_CODE = $(GMAIN) ../../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 ../../gloaduc.s
INST_LIB_TARGETS = $(UCODE).fifo.o
TARGETS = $(UCODE).fifo \
$(UCODE).fifo.u.tvd \
gclip.only.fifo.u.tvd \
gflight.fifo.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)
#
# what the heck is this?
#
ig: $(UCODE) $(UCODE).u.tvd gclip.only.u.tvd gflight.u.tvd \
gdone.u.tvd $(UCODE).o
$(INSTALL) -m 555 -F /usr/lib/PR $(UCODE).o
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.
#
# 'dd' is used to chop the data section to the minimum required, in
# order to save ROM/RAM space.
#
#
# the 3D polygon ucode with output to circular DRAM fifo:
#
$(UCODE).fifo: $(UCODE).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 $(UCODE).fifo.u -l 34 $(UCODE).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
$(UCODE).fifo.o: $(UCODE).fifo
${RSP2ELF} -p -r $?
$(UCODE).fifo.u.tvd: $(UCODE).fifo
${RSP2ELF} -p $(UCODE).fifo.u
gclip.only.fifo.u.tvd: $(UCODE).fifo
${RSP2ELF} -p gclip.only.fifo.u
gflight.fifo.u.tvd: $(UCODE).fifo
${RSP2ELF} -p gflight.fifo.u
gdone.fifo.u.tvd: $(UCODE).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: $(UCODE).fifo.u ../../newt.s ${GFX_INCL}
@echo "****"
@echo "**** Building $@:"
@echo "****"
${RSPASM} ${LCINCS} ${LCDEFS} -DNEWT_ALONE -S $(UCODE).fifo.u -o $@ ../../newt.s
$(UCODE).fifo.u: gclip.only_tmp.fifo.u gflight.fifo.u ../../fillnops $(UCODE)_tmp.fifo.u ${GFX_INCL} ${GFX_CODE}
@echo "****"
@echo "**** Building $@:"
@echo "****"
../../fillnops gclip.only_tmp.fifo.u.dbg clipKill $(UCODE)_tmp.fifo.u.dbg clipAndSetup 1 > gfillnops.fifo.s
${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DOUTPUT_FIFO -o $@ -S gclip.only_tmp.fifo.u $(GMAIN)
@echo " "
gboot.fifo.u: $(UCODE).fifo.u ../../gboot.s
${RSPASM} ${LCINCS} ${LCDEFS} -o $@ -S $(UCODE).fifo.u ../../gboot.s
$(UCODE)_tmp.fifo.u: ${GFX_INCL} ${GFX_CODE}
@echo "****"
@echo "**** Building $@:"
@echo "****"
${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNODATA -DOUTPUT_FIFO -o $@ $(GMAIN)
@echo " "
gclip.only_tmp.fifo.u: $(UCODE)_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 $(UCODE)_tmp.fifo.u ../../goverlays.s
gclip.only.fifo.u: $(UCODE).fifo.u ../../goverlays.s ../../gclip.s ${GFX_INCL}
@echo "****"
@echo "**** Building $@:"
@echo "****"
${RSPASM} ${LCINCS} ${LCDEFS} -DCLIP_ALONE -DPRECISE_CLIP -DNODATA -DOUTPUT_FIFO -o $@ -S $(UCODE).fifo.u ../../goverlays.s
gflight.fifo.u: $(UCODE)_tmp.fifo.u ../../gflight.s ../../goverlays.s ${GFX_INCL}
@echo "****"
@echo "**** Building $@:"
@echo "****"
${RSPASM} ${LCINCS} ${LCDEFS} -DFLIGHT -DNODATA -DOUTPUT_FIFO -o $@ -S $(UCODE)_tmp.fifo.u ../../goverlays.s
gdone.fifo.u: $(UCODE)_tmp.fifo.u ../../gdone.s ${GFX_INCL}
@echo "****"
@echo "**** Building $@:"
@echo "****"
${RSPASM} ${LCINCS} ${LCDEFS} -DFASTLIGHT3D -DNODATA -DOUTPUT_FIFO -o $@ -S $(UCODE)_tmp.fifo.u ../../gdone.s
# DO NOT DELETE THIS LINE -- make depend depends on it.