Update
[gdb.git] / sim / testsuite / common / Make-common.in
blob7afef4a99ddb0c6fa6bfd5602997f46993b6308c
1 AS_FOR_TARGET = `\
2   if [ -x ../../../gas/as-new ]; then \
3     echo ../../../gas/as-new ; \
4   else \
5     echo $(target_alias)-as ; \
6   fi`
8 LD_FOR_TARGET = `\
9   if [ -x ../../../ld/ld-new ]; then \
10     echo ../../../ld/ld-new ; \
11   else \
12     echo $(target_alias)-ld ; \
13   fi`
15 RUN_FOR_TARGET = `\
16   if [ -x ../../../sim/v850/run ]; then \
17     echo ../../../sim/v850/run ; \
18   else \
19     echo $(target_alias)-run ; \
20   fi`
23 check: sanity $(TESTS)
24 sanity:
25         @eval echo AS_FOR_TARGET=$(AS_FOR_TARGET)
26         @eval echo LD_FOR_TARGET=$(LD_FOR_TARGET)
27         @eval echo RUN_FOR_TARGET=$(RUN_FOR_TARGET)
29 clean:
30         rm -f $(TESTS)
31         rm -f *.run *.o
32         rm -f core *.core
34 # Rules for running the tests
36 .SUFFIXES: .ok .run .hi .ko .ti
37 .run.ok:
38         rm -f tmp-$* $*.hi
39         ulimit -t 5 ; \
40         $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
41         mv tmp-$* $*.ok
42 .run.hi:
43         rm -f tmp-$* $*.hi diff-$*
44         ulimit -t 5 ; \
45         $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
46         echo 'Hello World!' | diff - tmp-$* > diff-$*
47         cat tmp-$* diff-$* > $*.hi
48 .run.ko:
49         rm -f tmp-$* $*.ko
50         set +e ; \
51         ulimit -t 5 ; \
52         $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \
53         if [ $$? -eq 47 ] ; then \
54           exit 0 ; \
55         else \
56           exit 1 ; \
57         fi
58         mv tmp-$* $*.ko
59 .run.ti:
60         rm -f tmp-$* $*.ti
61         set +e ; \
62         ulimit -t 5 ; \
63         $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $(INTFLAGS_FOR_TARGET) $*.run > tmp-$*
64         test `cat tmp-$* | wc -l` -eq 10 < /dev/null
65         test `grep Tick tmp-$* | wc -l` -eq 10 < /dev/null
66         mv tmp-$* $*.ti
69 # Rules for building the test
70 # Preference is for obtaining the executable (.run) from a prebuilt image
72 .SUFFIXES: .uue .s .S .run
73 .uue.run:
74         head $* | grep $*.run > /dev/null
75         uudecode $*.uue
76 .run.u:
77         uuencode < $*.run $*.run > $*.u
78 .o.run:
79         $(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o
80 .s.o:
81         $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.s -o $*.o
82 .S.o:
83         $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.S -o $*.o
86 Makefile: Makefile.in config.status
87         $(SHELL) ./config.status
89 config.status: configure
90         $(SHELL) ./config.status --recheck