Commit | Line | Data |
---|---|---|
1a6eb36b AC |
1 | # Makefile for regression testing the GNU debugger. |
2 | # Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. | |
3 | ||
4 | # This file is part of GDB. | |
5 | ||
6 | # GDB is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2, or (at your option) | |
9 | # any later version. | |
10 | ||
11 | # GDB is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | ||
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this program; if not, write to the Free Software | |
18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | |
19 | ||
20 | VPATH = @srcdir@ | |
21 | srcdir = @srcdir@ | |
22 | srcroot = $(srcdir)/.. | |
23 | ||
24 | prefix = @prefix@ | |
25 | exec_prefix = @exec_prefix@ | |
26 | ||
27 | host_alias = @host_alias@ | |
28 | target_alias = @target_alias@ | |
29 | program_transform_name = @program_transform_name@ | |
30 | build_canonical = @build@ | |
31 | host_canonical = @host@ | |
32 | target_canonical = @target@ | |
33 | target_cpu = @target_cpu@ | |
34 | ||
35 | ||
36 | SHELL = /bin/sh | |
37 | SUBDIRS = @subdirs@ | |
38 | RPATH_ENVVAR = @RPATH_ENVVAR@ | |
1398204e | 39 | INTFLAGS_FOR_TARGET=--watch-cycles-nmi=+100 |
1a6eb36b AC |
40 | |
41 | EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \ | |
42 | echo $${rootme}/../../expect/expect ; \ | |
43 | else echo expect ; fi` | |
44 | ||
45 | RUNTEST = $(RUNTEST_FOR_TARGET) | |
46 | ||
47 | RUNTESTFLAGS = | |
48 | ||
49 | RUNTEST_FOR_TARGET = `\ | |
50 | if [ -f $${srcdir}/../../../dejagnu/runtest ]; then \ | |
51 | echo $${srcdir}/../../../dejagnu/runtest; \ | |
52 | else \ | |
53 | if [ "$(host_canonical)" = "$(target_canonical)" ]; then \ | |
54 | echo runtest; \ | |
55 | else \ | |
56 | t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \ | |
57 | fi; \ | |
58 | fi` | |
59 | ||
60 | ||
61 | AS_FOR_TARGET = `\ | |
63fe2cc7 AC |
62 | if [ -x ../../../gas/as-new ]; then \ |
63 | echo ../../../gas/as-new ; \ | |
1a6eb36b AC |
64 | else \ |
65 | echo $(target_alias)-as ; \ | |
66 | fi` | |
67 | ||
68 | LD_FOR_TARGET = `\ | |
63fe2cc7 AC |
69 | if [ -x ../../../ld/ld-new ]; then \ |
70 | echo ../../../ld/ld-new ; \ | |
1a6eb36b AC |
71 | else \ |
72 | echo $(target_alias)-ld ; \ | |
73 | fi` | |
74 | ||
75 | RUN_FOR_TARGET = `\ | |
76 | if [ -x ../../../sim/v850/run ]; then \ | |
77 | echo ../../../sim/v850/run ; \ | |
78 | else \ | |
79 | echo $(target_alias)-run ; \ | |
80 | fi` | |
81 | ||
65a87fa9 AC |
82 | |
83 | TESTS= \ | |
84 | hello.hi \ | |
85 | exit47.ko \ | |
1398204e | 86 | tick.ti \ |
65a87fa9 | 87 | \ |
1a6eb36b AC |
88 | t-bsh.ok \ |
89 | t-bsw.ok \ | |
fc07e279 | 90 | t-callt.ok \ |
f4822f1e | 91 | t-cmov.ok \ |
fc07e279 AC |
92 | t-ctret.ok \ |
93 | t-hsw.ok \ | |
f4822f1e AC |
94 | t-jarl.ok \ |
95 | t-jmp.ok \ | |
96 | t-jr.ok \ | |
1a6eb36b | 97 | t-ldsr.ok \ |
1398204e AC |
98 | t-popml.ok \ |
99 | t-popmh.ok \ | |
8bd89725 | 100 | t-sld.ok \ |
1a6eb36b AC |
101 | t-sxb.ok \ |
102 | t-sxh.ok \ | |
103 | t-zxb.ok \ | |
104 | t-zxh.ok \ | |
65a87fa9 AC |
105 | |
106 | check: sanity $(TESTS) | |
107 | sanity: | |
1a6eb36b AC |
108 | @eval echo AS_FOR_TARGET=$(AS_FOR_TARGET) |
109 | @eval echo LD_FOR_TARGET=$(LD_FOR_TARGET) | |
110 | @eval echo RUN_FOR_TARGET=$(RUN_FOR_TARGET) | |
65a87fa9 | 111 | |
1398204e AC |
112 | clean: |
113 | rm -f $(TESTS) | |
114 | rm -f *.run *.o | |
115 | rm -f core *.core | |
116 | ||
65a87fa9 AC |
117 | # Rules for running the tests |
118 | ||
1398204e | 119 | .SUFFIXES: .ok .run .hi .ko .ti |
65a87fa9 AC |
120 | .run.ok: |
121 | rm -f tmp-$* $*.hi | |
122 | ulimit -t 5 ; \ | |
123 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* | |
124 | mv tmp-$* $*.ok | |
125 | .run.hi: | |
126 | rm -f tmp-$* $*.hi diff-$* | |
127 | ulimit -t 5 ; \ | |
128 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* | |
129 | echo 'Hello World!' | diff - tmp-$* > diff-$* | |
130 | cat tmp-$* diff-$* > $*.hi | |
131 | .run.ko: | |
132 | rm -f tmp-$* $*.ko | |
133 | set +e ; \ | |
134 | ulimit -t 5 ; \ | |
135 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \ | |
136 | if [ $$? -eq 47 ] ; then \ | |
137 | exit 0 ; \ | |
138 | else \ | |
139 | exit 1 ; \ | |
140 | fi | |
141 | mv tmp-$* $*.ko | |
1398204e AC |
142 | .run.ti: |
143 | rm -f tmp-$* $*.ti | |
144 | set +e ; \ | |
145 | ulimit -t 5 ; \ | |
146 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $(INTFLAGS_FOR_TARGET) $*.run > tmp-$* | |
147 | test `cat tmp-$* | wc -l` -eq 10 < /dev/null | |
148 | test `grep Tick tmp-$* | wc -l` -eq 10 < /dev/null | |
149 | mv tmp-$* $*.ti | |
65a87fa9 AC |
150 | |
151 | # Rules for building the test | |
152 | # Preference is for obtaining the executable (.run) from a prebuilt image | |
153 | ||
154 | .SUFFIXES: .uue .s .S .run | |
155 | .uue.run: | |
156 | head $* | grep $*.run > /dev/null | |
157 | uudecode $*.uue | |
158 | .run.u: | |
159 | uuencode < $*.run $*.run > $*.u | |
160 | .o.run: | |
161 | $(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o | |
162 | .s.o: | |
1a6eb36b | 163 | $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.s -o $*.o |
65a87fa9 | 164 | .S.o: |
1a6eb36b | 165 | $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.S -o $*.o |
65a87fa9 | 166 | # NNN |
1398204e AC |
167 | |
168 | Makefile: Makefile.in config.status | |
169 | $(SHELL) ./config.status | |
170 | ||
171 | config.status: configure | |
172 | $(SHELL) ./config.status --recheck | |
173 |