GNUmakefile
3.85 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
#!smake -k
# --------------------------------------------------------------------
# Copyright (C) 1997 Nintendo. (Originated by SGI)
#
# $RCSfile: GNUmakefile,v $
# $Revision: 1.1 $
# $Date: 2003/04/04 17:27:09 $
# --------------------------------------------------------------------
#
# Makefile for RSP verification application test suite.
#
include $(ROOT)/usr/include/make/PRdefs
APP = rspverif
APP_EM = rspverif_em
OPTIMIZER = -g
TARGETS = rom
EMULATE = $(ROOT)/usr/sbin/emulate
TEXHFILES =
HFILES = rspverif.h texture.h controller.h
GENHFILES = map.h CI8ramp.h CI4ramp.h
CODEFILES = rspverif.c main.c controller.c dram_stack.c dram_yield.c \
rdp_output.c rdp_output_len.c
CODEOBJECTS = $(CODEFILES:.c=.o)
DATAFILES = zbuffer.c init.c static.c cfb.c texture.c
DATAOBJECTS = $(GENHFILES) $(DATAFILES:.c=.o)
CODESEGMENT = codesegment.o
OBJECTS = $(CODESEGMENT) $(DATAOBJECTS)
LCINCS = -I. -I$(ROOT)/usr/include/PR -I $(ROOT)/usr/include
LCOPTS = -Wall -non_shared -G 0 -mips2
LDIRT = $(APP) $(APP_EM) rspverif rspverif_em $(GENHFILES) \
InData/test*Z $(TEXHFILES)
LDFLAGS = $(MKDEPOPT) -L$(ROOT)/usr/lib -L$(ROOT)/usr/lib/PR \
-lultra_d -lgcc
LCDEFS =
default: $(TARGETS)
include $(COMMONRULES)
#
# what does it mean to 'install' this thing?
#
install: default
$(INSTALL) -m 444 -F /usr/src/PR/demos/rspverif Makefile spec \
$(HFILES) $(CODEFILES) $(DATAFILES)
$(CODESEGMENT): $(CODEOBJECTS)
$(LD) -o $(CODESEGMENT) -r $(CODEOBJECTS) $(LDFLAGS)
#
# This must depend on the generated h-files, which in turn depend
# on the cases utility. If we don't do this, smake fails.
#
texture.c: $(GENHFILES)
rom $(APP): spec $(OBJECTS) $(MAKEROM)
$(MAKEROM) -r rom spec
#
# Files specific to Hardware/Emulator
#
main.o: main.c
$(CC) $(CFLAGS) $(LCDEFS) -c $<
rspverif.o: rspverif.c
$(CC) $(CFLAGS) $(LCDEFS) -c $<
static.o: static.c
$(CC) $(CFLAGS) $(LCDEFS) -c $<
#
# ADD TEST CASE:
#
# Note: due to fopen() restrictions in the rsp simulator, the
# directory you send the output to must exist before running...
#
NIGHTLY_REGRESSION_TEST_ARCHIVE =
OTHER_TESTS_ARCHIVE =
NIGHTLY_REGRESSION_TESTS = ${NIGHTLY_REGRESSION_TEST_ARCHIVE:R:R:R:R:T}
NIGHTLY_REGRESSION_TEST_TARGETS = ${NIGHTLY_REGRESSION_TEST_ARCHIVE:R}
OTHER_TESTS = ${OTHER_TESTS_ARCHIVE:R:R:R:R:T}
OTHER_TESTS_TARGETS = ${OTHER_TESTS_ARCHIVE:R}
TESTS = ${OTHER_TESTS} ${NIGHTLY_REGRESSION_TESTS}
#
# Header file build rules
#
map.h: mktex.c
$(HOST_CC) -o mktex mktex.c
./mktex > map.h
rm -rf mktex
CI8ramp.h: make_ci8_tex.c
$(HOST_CC) -D_LANGUAGE_C -g -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR \
-o make_ci8_tex make_ci8_tex.c
./make_ci8_tex $(LCDEFS) > CI8ramp.h
rm -rf make_ci8_tex
CI4ramp.h: make_ci4_tex.c
$(HOST_CC) -D_LANGUAGE_C -g -I$(ROOT)/usr/include -I$(ROOT)/usr/include/PR \
-o make_ci4_tex make_ci4_tex.c
./make_ci4_tex $(LCDEFS) > CI4ramp.h
rm -rf make_ci4_tex
#
# Anti-aliased
#
test000: InData/test000.0.rdp.Z
InData/test000.0.rdp.Z: $(APP)
$(EMULATE) -n -s -a "-m -a -o 0 -n InData/test000" $(APP) rom
compress -f InData/test000*.rdp
tests: $(TESTS)
#
# Run a smaller subset of the total test coverage on a nightly basis.
#
nightly_regression: $(NIGHTLY_REGRESSION_TESTS)
#
# Only checkin archived versions of the .rdp files on a periodic,
# on-demand basis (e.g. whenever an RSP simulator/ucode change affects the
# output files mumble.rdp).
#
# Otherwise we'll pollute the source tree with unnecessary copies
# of these data files. The intent is to provide a way to resurrect data
# files for downstream simulation purposes whenever the output files generated
# by the rsp sim environment causes a hiccup downstream.
#
periodic_checkin: $(NIGHTLY_REGRESSION_TESTS)
$(ROOT)/PR/tools/scripts/copyToArchive $(NIGHTLY_REGRESSION_TEST_TARGETS)