Commit | Line | Data |
---|---|---|
c906108c SS |
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@ | |
39 | ||
40 | TESTS = \ | |
41 | exit47.ko \ | |
42 | hello.hi \ | |
43 | t-dbt.ok \ | |
cff3e48b | 44 | t-ld-st.ok \ |
c906108c SS |
45 | t-mac.ok \ |
46 | t-mvtac.ok \ | |
47 | t-mvtc.ok \ | |
48 | t-msbu.ok \ | |
49 | t-mulxu.ok \ | |
50 | t-rac.ok \ | |
51 | t-rachi.ok \ | |
52 | t-rdt.ok \ | |
53 | t-rep.ok \ | |
54 | t-rte.ok \ | |
cff3e48b JM |
55 | t-sac.ok \ |
56 | t-sachi.ok \ | |
c906108c | 57 | t-sadd.ok \ |
cff3e48b | 58 | t-slae.ok \ |
c906108c SS |
59 | t-sp.ok \ |
60 | t-sub2w.ok \ | |
61 | t-sub.ok \ | |
62 | t-subi.ok \ | |
63 | # | |
64 | ||
65 | AS_FOR_TARGET = `\ | |
66 | if [ -x ../../../gas/as-new ]; then \ | |
67 | echo ../../../gas/as-new ; \ | |
68 | else \ | |
69 | echo $(target_alias)-as ; \ | |
70 | fi` | |
71 | ||
72 | LD_FOR_TARGET = `\ | |
73 | if [ -x ../../../ld/ld-new ]; then \ | |
74 | echo ../../../ld/ld-new ; \ | |
75 | else \ | |
76 | echo $(target_alias)-ld ; \ | |
77 | fi` | |
78 | ||
79 | RUN_FOR_TARGET = `\ | |
80 | if [ -x ../../../sim/d10v/run ]; then \ | |
81 | echo ../../../sim/d10v/run ; \ | |
82 | else \ | |
83 | echo $(target_alias)-run ; \ | |
84 | fi` | |
85 | ||
86 | ||
87 | check: sanity $(TESTS) | |
88 | sanity: | |
89 | @eval echo AS_FOR_TARGET=$(AS_FOR_TARGET) | |
90 | @eval echo LD_FOR_TARGET=$(LD_FOR_TARGET) | |
91 | @eval echo RUN_FOR_TARGET=$(RUN_FOR_TARGET) | |
92 | ||
93 | clean: | |
94 | rm -f $(TESTS) | |
95 | rm -f *.run *.o | |
96 | rm -f core *.core | |
97 | ||
98 | # Rules for running the tests | |
99 | ||
100 | .SUFFIXES: .ok .run .hi .ko .ti | |
101 | .run.ok: | |
102 | rm -f tmp-$* $*.hi | |
103 | ulimit -t 5 ; \ | |
104 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* | |
105 | mv tmp-$* $*.ok | |
106 | .run.hi: | |
107 | rm -f tmp-$* $*.hi diff-$* | |
108 | ulimit -t 5 ; \ | |
109 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* | |
110 | echo 'Hello World!' | diff - tmp-$* > diff-$* | |
111 | cat tmp-$* diff-$* > $*.hi | |
112 | .run.ko: | |
113 | rm -f tmp-$* $*.ko | |
114 | set +e ; \ | |
115 | ulimit -t 5 ; \ | |
116 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \ | |
117 | if [ $$? -eq 47 ] ; then \ | |
118 | exit 0 ; \ | |
119 | else \ | |
120 | exit 1 ; \ | |
121 | fi | |
122 | mv tmp-$* $*.ko | |
123 | .run.ti: | |
124 | rm -f tmp-$* $*.ti | |
125 | set +e ; \ | |
126 | ulimit -t 5 ; \ | |
127 | $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $(INTFLAGS_FOR_TARGET) $*.run > tmp-$* | |
128 | test `cat tmp-$* | wc -l` -eq 10 < /dev/null | |
129 | test `grep Tick tmp-$* | wc -l` -eq 10 < /dev/null | |
130 | mv tmp-$* $*.ti | |
131 | ||
132 | ||
133 | # Rules for building the test | |
134 | # Preference is for obtaining the executable (.run) from a prebuilt image | |
135 | ||
136 | .SUFFIXES: .uue .s .S .run | |
137 | .uue.run: | |
138 | head $* | grep $*.run > /dev/null | |
139 | uudecode $*.uue | |
140 | .run.u: | |
141 | uuencode < $*.run $*.run > $*.u | |
142 | .o.run: | |
143 | $(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o | |
144 | .s.o: | |
145 | $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.s -o $*.o | |
146 | .S.o: | |
147 | $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.S -o $*.o | |
148 | ||
149 | ||
150 | Makefile: Makefile.in config.status | |
151 | $(SHELL) ./config.status | |
152 | ||
153 | config.status: configure | |
154 | $(SHELL) ./config.status --recheck |