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