* Makefile.in (ULIMIT): New variable.
[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 = 30
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)
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
177 ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > sce$*_our_gif.dat; \
178 if [ $$? -ne 0 ]; then \
179 touch sce$*.ok; \
180 else \
181 echo Running sce$*.exe returns $$? > sce$*.ok ;\
182 fi
183
184 # else \
185 # diff -bitw sce$*_out_dif.dat sce$*_our_gif.dat > sce$*.ok; \
186 # fi
187
188 #------------------------
189 # Rules for running tests
190 #------------------------
191
192 .run.ok:
193 rm -f tmp-$* $*.hi
194 ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$*
195 mv tmp-$* $*.ok
196 .run.ko:
197 rm -f tmp-$* $*.ko
198 set +e ; \
199 ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$* ; \
200 if [ $$? -ne 0 ] ; then \
201 exit 0 ; \
202 else \
203 exit 1 ; \
204 fi
205 mv tmp-$* $*.ko
206 .vif0out.vif0ok:
207 diff $(srcdir)/$*.vif0expect $<
208 touch $@
209 .vif1out.vif1ok:
210 diff $(srcdir)/$*.vif1expect $<
211 touch $@
212 .vuout.vuok:
213 diff $(srcdir)/$*.vuexpect $<
214
215
216 #------------------------------------
217 # Rules for building the TESTS
218 #------------------------------------
219
220 .trc.c:
221 $(C_GEN) $< $@
222 .c.run:
223 $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) -o $@ $<
224 .uu.run:
225 uudecode $< > $@
226 .run.vif0out:
227 rm -f $@
228 -env VIF0_TRACE_FILE=$@ $(RUN_FOR_TARGET) $<
229 .run.vif1out:
230 rm -f $@
231 -env VIF1_TRACE_FILE=$@ $(RUN_FOR_TARGET) $<
232 .run.vuout:
233 rm -f $@
234 -env SKY_DEBUG=inst_trace $(RUN_FOR_TARGET) $< > $@
235 .s.run:
236 rm -f $@
237 $(AS_FOR_TARGET) -mcpu=r5900 -o $@ $<
238 .c.s:
239 $(GCC_FOR_TARGET) -S -o $@ $<
240
241
242 #
243 # Standard
244 #
245 clean mostlyclean:
246 -rm -f *~ core *.o a.out *.x *.grt
247 -rm -f *.vif*out *.ok tmp-*
248 rm -f $(TESTS)
249 rm -f $(SCE_TESTS) sce*our_gif.dat sce*.exe *.vubin a.raw
250 # if [ x"${SUBDIRS}" != x ] ; then \
251 # for dir in ${SUBDIRS}; \
252 # do \
253 # echo "$$dir:"; \
254 # if [ -d $$dir ]; then \
255 # (cd $$dir; $(MAKE) clean); \
256 # fi; \
257 # done ; \
258 # else true; fi
259
260 distclean maintainer-clean realclean: clean
261 -rm -f *~ core
262 -rm -f Makefile config.status *-init.exp
263 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
264 -rm -f a.raw
265 # if [ x"${SUBDIRS}" != x ] ; then \
266 # for dir in ${SUBDIRS}; \
267 # do \
268 # echo "$$dir:"; \
269 # if [ -d $$dir ]; then \
270 # (cd $$dir; $(MAKE) distclean); \
271 # fi; \
272 # done ; \
273 # else true; fi
274
275 Makefile : Makefile.in config.status
276 $(SHELL) config.status
277
278 config.status: configure
279 $(SHELL) config.status --recheck