Fixing typos.
[binutils-gdb.git] / sim / testsuite / sky / Makefile.in
1 # Makefile for regression testing the sky simulator.
2
3 VPATH = @srcdir@
4 srcdir = @srcdir@
5 srcroot = $(srcdir)/..
6
7 prefix = @prefix@
8 exec_prefix = @exec_prefix@
9 bindir = $(exec_prefix)/bin
10
11 host_alias = @host_alias@
12 target_alias = @target_alias@
13 program_transform_name = @program_transform_name@
14 build_canonical = @build@
15 host_canonical = @host@
16 target_canonical = @target@
17 target_cpu = @target_cpu@
18
19
20 SHELL = /bin/sh
21 SUBDIRS = @subdirs@
22 RPATH_ENVVAR = @RPATH_ENVVAR@
23
24 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
25 echo $${rootme}/../../expect/expect ; \
26 else echo expect ; fi`
27
28 RUNTEST = $(RUNTEST_FOR_TARGET)
29
30 RUNTESTFLAGS =
31
32 RUNTEST_FOR_TARGET = `\
33 if [ -f $${srcdir}/../../../dejagnu/runtest ]; then \
34 echo $${srcdir}/../../../dejagnu/runtest; \
35 else \
36 if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
37 echo runtest; \
38 else \
39 t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
40 fi; \
41 fi`
42
43 DVPAS_FOR_TARGET := `\
44 if [ -x ${bindir}/dvp-elf-as ]; then \
45 echo ${bindir}/dvp-elf-as ; \
46 else \
47 echo $(target_alias)-as ; \
48 fi`
49
50 DVPOBJCP_FOR_TARGET := `\
51 if [ -x ${bindir}/dvp-elf-objcopy ]; then \
52 echo ${bindir}/dvp-elf-objcopy ; \
53 else \
54 echo $(target_alias)-objcopy ; \
55 fi`
56
57 AS_FOR_TARGET := `\
58 if [ -x ../../../gas/as-new ]; then \
59 echo ../../../gas/as-new ; \
60 else \
61 echo $(target_alias)-as ; \
62 fi`
63
64 LD_FOR_TARGET := `\
65 if [ -x ../../../ld/ld-new ]; then \
66 echo ../../../ld/ld-new ; \
67 else \
68 echo $(target_alias)-ld ; \
69 fi`
70
71
72 RUNOPTS =
73
74 RUN_FOR_TARGET := `\
75 if [ -x ../../../sim/mips/run ]; then \
76 echo ../../../sim/mips/run ; \
77 else \
78 echo $(target_alias)-run ; \
79 fi` $(RUNOPTS)
80
81 GCC_FOR_TARGET := `\
82 if [ -x ../../../gcc/xgcc ]; then \
83 echo ../../../gcc/xgcc ; \
84 else \
85 echo $(target_alias)-gcc ; \
86 fi`
87
88 C_GEN = perl $(srcdir)/c_gen.pl
89
90 # cpu time limit (in seconds)
91 ULIMIT = 60
92
93 .SUFFIXES: .trc .c .run .ok \
94 .vif0out .vif0ok .vif0expect \
95 .vif1out .vif1ok .vif1expect \
96 .vuout .vuok .vuexpect \
97 .uu \
98 .dvpasm .vuasm
99
100 TESTS = \
101 t-dma.ok \
102 t-pke2.vif1ok t-pke3.ok t-pke4.vif0ok \
103 tss08_0.ok tss08_1.ok \
104 tss16_0.ok tss16_1.ok \
105 tss32_0.ok tss32_1.ok \
106 tsv208_0.ok tsv208_1.ok \
107 tsv216_0.ok tsv216_1.ok \
108 tsv232_0.ok tsv232_1.ok \
109 tsv308_0.ok tsv308_1.ok \
110 tsv316_0.ok tsv316_1.ok \
111 tsv332_0.ok tsv332_1.ok \
112 tsv408_0.ok tsv408_1.ok \
113 tsv416_0.ok tsv416_1.ok \
114 tsv432_0.ok tsv432_1.ok \
115 t-cop2.vuok t-cop2b.ok
116
117 #SCE_TESTS := $(patsubst %.dvpasm, %.ok, $(wildcard sce*.dvpasm))
118 SCE_TESTS = \
119 sce_test1.ok sce_test2.ok sce_test3.ok sce_test4.ok \
120 sce_test5.ok sce_test6.ok sce_test7.ok sce_test8.ok \
121 sce_test9.ok sce_test10.ok sce2_test11.ok sce2_test12.ok \
122 sce_test13.ok sce_test14.ok sce_test15.ok sce_test16.ok \
123 sce_test17.ok sce_test18.ok sce_test19.ok sce_test20.ok \
124 sce_test21.ok sce_test22.ok sce2_test23.ok sce_test24.ok \
125 sce_test25.ok sce_test26.ok sce_test27.ok sce_test28.ok \
126 sce_test29.ok sce_test30.ok sce_test31.ok sce_test32.ok \
127 sce_test33.ok sce_test34.ok sce_test35.ok sce_test36.ok \
128 sce_test37.ok sce_test38.ok sce_test39.ok sce_test40.ok \
129 sce_test41.ok sce_test42.ok sce_test43.ok sce_test44.ok \
130 sce_test45.ok sce_test46.ok sce_test47.ok sce_test48.ok \
131 sce_test49.ok sce_test50.ok sce_test51.ok sce_test52.ok \
132 sce_test53.ok sce_test54.ok sce_test55.ok sce_test56.ok \
133 sce_test57.ok sce_test58.ok sce_test59.ok
134
135 check: sanity $(TESTS) $(SCE_TESTS)
136 check_sce: sanity $(SCE_TESTS)
137
138 sanity:
139 @eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
140 @eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
141 @eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
142 @eval echo GCC_FOR_TARGET = $(GCC_FOR_TARGET)
143 @eval echo DVPAS_FOR_TARGET = $(DVPAS_FOR_TARGET)
144 @eval echo DVPOBJCP_FOR_TARGET = $(DVPOBJCP_FOR_TARGET)
145
146 #------------------------------------
147 # Rules for building and running the SCE tests :
148 #------------------------------------
149
150 LDFLAGS=-T$(srcdir)/sky.ld
151 CFLAGS += -g -I$(srcdir)
152 ASFLAGS = -I$(srcdir)
153
154 sce%.exe: sce%.o sce_main.o refresh.o
155 $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) sce_main.o refresh.o -o $@ $<
156
157 sce_main.o: sce_main.c
158 $(GCC_FOR_TARGET) -c $(CFLAGS) -o $@ $<
159
160 refresh.o: refresh.s
161 $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
162
163 sce_%.o: sce_%.dvpasm sce_%.vuasm
164 $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
165
166 sce2_%.o: sce2_%.dvpasm sce2_%.vubin
167 $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
168
169 sce2_%.vubin: sce2_%.vu.o
170 $(DVPOBJCP_FOR_TARGET) -O binary $< $@
171
172 sce2_%.vu.o: sce2_%.vuasm
173 $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
174
175 sce%.ok: sce%.exe
176 rm -f sce$*.ok sce$*_our_gif.dat
177 GIF_TRACE=sce$*_our_gif.dat ; export GIF_TRACE; \
178 ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< ; \
179 if [ $$? -ne 0 ]; then \
180 diff -bitw $(srcdir)/sce$*_out_gif.dat sce$*_our_gif.dat > sce$*.ok; \
181 touch sce$*.ok; \
182 else \
183 echo Running sce$*.exe returns $$? > sce$*.ok ;\
184 fi
185
186 #------------------------
187 # Rules for running tests
188 #------------------------
189
190 .run.ok:
191 rm -f tmp-$* $*.hi
192 ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$*
193 mv tmp-$* $*.ok
194 .run.ko:
195 rm -f tmp-$* $*.ko
196 set +e ; \
197 ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$* ; \
198 if [ $$? -ne 0 ] ; then \
199 exit 0 ; \
200 else \
201 exit 1 ; \
202 fi
203 mv tmp-$* $*.ko
204 .vif0out.vif0ok:
205 diff $(srcdir)/$*.vif0expect $<
206 touch $@
207 .vif1out.vif1ok:
208 diff $(srcdir)/$*.vif1expect $<
209 touch $@
210 .vuout.vuok:
211 diff $(srcdir)/$*.vuexpect $<
212
213
214 #------------------------------------
215 # Rules for building the TESTS
216 #------------------------------------
217
218 .trc.c:
219 $(C_GEN) $< $@
220 .c.run:
221 $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) -o $@ $<
222 .uu.run:
223 uudecode $< > $@
224 .run.vif0out:
225 rm -f $@
226 -env VIF0_TRACE_FILE=$@ $(RUN_FOR_TARGET) $<
227 .run.vif1out:
228 rm -f $@
229 -env VIF1_TRACE_FILE=$@ $(RUN_FOR_TARGET) $<
230 .run.vuout:
231 rm -f $@
232 -env SKY_DEBUG=inst_trace $(RUN_FOR_TARGET) $< > $@
233 .s.run:
234 rm -f $@
235 $(AS_FOR_TARGET) -mcpu=r5900 -o $@ $<
236 .c.s:
237 $(GCC_FOR_TARGET) -S -o $@ $<
238
239
240 #
241 # Standard
242 #
243 clean mostlyclean:
244 -rm -f *~ core *.o a.out *.x *.grt
245 -rm -f *.vif*out *.ok tmp-*
246 rm -f $(TESTS)
247 rm -f $(SCE_TESTS) sce*our_gif.dat sce*.exe *.vubin a.raw
248 # if [ x"${SUBDIRS}" != x ] ; then \
249 # for dir in ${SUBDIRS}; \
250 # do \
251 # echo "$$dir:"; \
252 # if [ -d $$dir ]; then \
253 # (cd $$dir; $(MAKE) clean); \
254 # fi; \
255 # done ; \
256 # else true; fi
257
258 distclean maintainer-clean realclean: clean
259 -rm -f *~ core
260 -rm -f Makefile config.status *-init.exp
261 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
262 -rm -f a.raw
263 # if [ x"${SUBDIRS}" != x ] ; then \
264 # for dir in ${SUBDIRS}; \
265 # do \
266 # echo "$$dir:"; \
267 # if [ -d $$dir ]; then \
268 # (cd $$dir; $(MAKE) distclean); \
269 # fi; \
270 # done ; \
271 # else true; fi
272
273 Makefile : Makefile.in config.status
274 $(SHELL) config.status
275
276 config.status: configure
277 $(SHELL) config.status --recheck