1 # Makefile for regression testing the GNU debugger.
2 # Copyright (C) 1992, 1993, 1994, 1995, 2007 Free Software Foundation, Inc.
4 # This file is part of GDB.
6 # This program 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 3 of the License, or
9 # (at your option) any later version.
11 # This program 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.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
21 srcroot = $(srcdir)/..
24 exec_prefix = @exec_prefix@
26 host_alias = @host_alias@
27 target_alias = @target_alias@
28 program_transform_name = @program_transform_name@
29 build_canonical = @build@
30 host_canonical = @host@
31 target_canonical = @target@
32 target_cpu = @target_cpu@
37 RPATH_ENVVAR = @RPATH_ENVVAR@
89 if [ -x ../../../gas/as-new ]; then \
90 echo ../../../gas/as-new ; \
92 echo $(target_alias)-as ; \
96 if [ -x ../../../ld/ld-new ]; then \
97 echo ../../../ld/ld-new ; \
99 echo $(target_alias)-ld ; \
103 if [ -x ../../../sim/d10v/run ]; then \
104 echo ../../../sim/d10v/run ; \
106 echo $(target_alias)-run ; \
109 # Force d10v into operating mode.
110 RUNFLAGS_FOR_TARGET=-o
113 check: sanity $(TESTS)
115 @eval echo AS_FOR_TARGET=$(AS_FOR_TARGET)
116 @eval echo LD_FOR_TARGET=$(LD_FOR_TARGET)
117 @eval echo RUN_FOR_TARGET=$(RUN_FOR_TARGET)
124 # Rules for running the tests
126 .SUFFIXES: .ok .run .hi .ko .ti
130 $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
133 rm -f tmp-$* $*.hi diff-$*
135 $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$*
136 echo 'Hello World!' | diff - tmp-$* > diff-$*
137 cat tmp-$* diff-$* > $*.hi
142 $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $*.run > tmp-$* ; \
143 if [ $$? -eq 47 ] ; then \
153 $(RUN_FOR_TARGET) $(RUNFLAGS_FOR_TARGET) $(INTFLAGS_FOR_TARGET) $*.run > tmp-$*
154 test `cat tmp-$* | wc -l` -eq 10 < /dev/null
155 test `grep Tick tmp-$* | wc -l` -eq 10 < /dev/null
159 # Rules for building the test
160 # Preference is for obtaining the executable (.run) from a prebuilt image
162 .SUFFIXES: .uue .s .S .run
164 head $* | grep $*.run > /dev/null
167 uuencode < $*.run $*.run > $*.u
169 $(LD_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o $*.run $*.o
171 $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.s -o $*.o
173 $(AS_FOR_TARGET) $(ASFLAGS_FOR_TARGET) -I$(srcdir) $(srcdir)/$*.S -o $*.o
176 Makefile: Makefile.in config.status
177 $(SHELL) ./config.status
179 config.status: configure
180 $(SHELL) ./config.status --recheck