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