Update Makefile.in to use dvp-el-as for SKY testcases.
[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 # Note: we want to use dvp-elf-as for the SKY testcase,
44 # not the mips64r5900 one.
45 AS_FOR_TARGET = `\
46 if [ -x ${bindir}/dvp-elf-as ]; then \
47 echo ${bindir}/dvp-elf-as ; \
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 ${bindir}/dvp-elf-objcopy ]; then \
61 echo ${bindir}/dvp-elf-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 CFLAGS += -I$(srcdir)
142 ASFLAGS = -a -I$(srcdir)
143
144 sce%.exe: sce%.o sce_main.o refresh.o
145 $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) sce_main.o refresh.o -o $@ $<
146
147 sce_main.o: sce_main.c
148 $(GCC_FOR_TARGET) -c $(CFLAGS) -o $@ $<
149
150 refresh.o: refresh.s
151 $(AS_FOR_TARGET) $(ASFLAGS) -o $@ $<
152
153 sce_%.o: sce_%.dvpasm sce_%.vuasm
154 $(AS_FOR_TARGET) $(ASFLAGS) -o $@ $<
155
156 sce2_%.o: sce2_%.dvpasm sce2_%.vubin
157 $(AS_FOR_TARGET) $(ASFLAGS) -o $@ $<
158
159 sce2_%.vubin: sce2_%.vu.o
160 $(OBJCOPY_FOR_TARGET) -O binary $< $@
161
162 sce2_%.vu.o: sce2_%.vuasm
163 $(AS_FOR_TARGET) $(ASFLAGS) -o $@ $<
164
165 sce%.ok: sce%.exe
166 rm -f sce$*.ok
167 ulimit -t 30 ; $(RUN_FOR_TARGET) $< > sce$*_our_gif.dat; \
168 if [ $$? -ne 0 ]; then \
169 echo Running sce$*.exe returns $$? > sce$*.ok ; \
170 else \
171 diff -bitw sce$*_out_dif.dat sce$*_our_gif.dat > sce$*.ok; \
172 fi
173
174
175 #------------------------------------
176 # Rules for running the TESTS
177 #------------------------------------
178
179 .run.ok:
180 rm -f tmp-$* $*.hi
181 ulimit -t 30 ; $(RUN_FOR_TARGET) $< > tmp-$*
182 mv tmp-$* $*.ok
183 .run.ko:
184 rm -f tmp-$* $*.ko
185 set +e ; \
186 ulimit -t 30 ; $(RUN_FOR_TARGET) $< > tmp-$* ; \
187 if [ $$? -ne 0 ] ; then \
188 exit 0 ; \
189 else \
190 exit 1 ; \
191 fi
192 mv tmp-$* $*.ko
193 .vif0out.vif0ok:
194 diff $(srcdir)/$*.vif0expect $<
195 touch $@
196 .vif1out.vif1ok:
197 diff $(srcdir)/$*.vif1expect $<
198 touch $@
199
200 #------------------------------------
201 # Rules for building the TESTS
202 #------------------------------------
203
204 .trc.c:
205 $(C_GEN) $< $@
206 .c.run:
207 $(GCC_FOR_TARGET) -T$(srcdir)/sky.ld -o $@ $<
208 .uu.run:
209 uudecode $< > $@
210 .run.vif0out:
211 rm -f $@
212 -env VIF0_TRACE_FILE=$@ $(RUN_FOR_TARGET) $<
213 .run.vif1out:
214 rm -f $@
215 -env VIF1_TRACE_FILE=$@ $(RUN_FOR_TARGET) $<
216
217
218
219 #
220 # Standard
221 #
222 clean mostlyclean:
223 -rm -f *~ core *.o a.out *.x *.grt
224 -rm -f *.vif*out *.ok tmp-*
225 rm -f $(TESTS)
226 rm -f $(SCE_TESTS) sce*our_gif.dat sce*.exe a.raw
227 # if [ x"${SUBDIRS}" != x ] ; then \
228 # for dir in ${SUBDIRS}; \
229 # do \
230 # echo "$$dir:"; \
231 # if [ -d $$dir ]; then \
232 # (cd $$dir; $(MAKE) clean); \
233 # fi; \
234 # done ; \
235 # else true; fi
236
237 distclean maintainer-clean realclean: clean
238 -rm -f *~ core
239 -rm -f Makefile config.status *-init.exp
240 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
241 -rm -f a.raw
242 # if [ x"${SUBDIRS}" != x ] ; then \
243 # for dir in ${SUBDIRS}; \
244 # do \
245 # echo "$$dir:"; \
246 # if [ -d $$dir ]; then \
247 # (cd $$dir; $(MAKE) distclean); \
248 # fi; \
249 # done ; \
250 # else true; fi
251
252 Makefile : Makefile.in config.status
253 $(SHELL) config.status
254
255 config.status: configure
256 $(SHELL) config.status --recheck