]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/Makefile.in
[AArch64] Cortex-A53 erratum 835769 linker workaround
[thirdparty/binutils-gdb.git] / gdb / testsuite / Makefile.in
CommitLineData
c906108c 1# Makefile for regression testing the GNU debugger.
ecd75fc8 2# Copyright 1992-2014 Free Software Foundation, Inc.
c906108c
SS
3
4# This file is part of GDB.
5
d53a7b30 6# This program is free software; you can redistribute it and/or modify
c906108c 7# it under the terms of the GNU General Public License as published by
d53a7b30
JB
8# the Free Software Foundation; either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
c906108c
SS
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.
d53a7b30 15#
c906108c 16# You should have received a copy of the GNU General Public License
d53a7b30 17# along with this program. If not, see <http://www.gnu.org/licenses/>.
c906108c
SS
18
19VPATH = @srcdir@
20srcdir = @srcdir@
21prefix = @prefix@
22exec_prefix = @exec_prefix@
b8b4e42b 23abs_builddir = @abs_builddir@
c906108c 24
be2a5f71 25target_alias = @target_noncanonical@
c906108c
SS
26program_transform_name = @program_transform_name@
27build_canonical = @build@
28host_canonical = @host@
29target_canonical = @target@
c906108c
SS
30
31SHELL = @SHELL@
93076499 32EXEEXT = @EXEEXT@
c906108c
SS
33SUBDIRS = @subdirs@
34RPATH_ENVVAR = @RPATH_ENVVAR@
2f1d9bdd 35ALL_SUBDIRS = gdb.ada gdb.arch gdb.asm gdb.base gdb.btrace gdb.cell gdb.cp \
7f420862 36 gdb.disasm gdb.dlang gdb.dwarf2 gdb.fortran gdb.gdb gdb.go gdb.hp \
f8eba3c6 37 gdb.java gdb.linespec gdb.mi gdb.modula2 gdb.multi \
1d41d745 38 gdb.objc gdb.opencl gdb.opt gdb.pascal gdb.python gdb.server \
30e62689 39 gdb.stabs gdb.reverse gdb.threads gdb.trace gdb.xml \
f4b49756 40 $(SUBDIRS)
c906108c 41
2a31c623
PA
42EXTRA_RULES = @EXTRA_RULES@
43
44CC=@CC@
45
46EXPECT = `if [ "$${READ1}" != "" ] ; then \
47 echo $${rootme}/expect-read1; \
48 elif [ -f $${rootme}/../../expect/expect ] ; then \
49 echo $${rootme}/../../expect/expect ; \
50 else \
51 echo expect ; \
52 fi`
c906108c
SS
53
54RUNTEST = $(RUNTEST_FOR_TARGET)
55
56RUNTESTFLAGS =
57
6bc80edc
TT
58FORCE_PARALLEL =
59
c906108c
SS
60RUNTEST_FOR_TARGET = `\
61 if [ -f $${srcdir}/../../dejagnu/runtest ]; then \
62 echo $${srcdir}/../../dejagnu/runtest; \
63 else \
64 if [ "$(host_canonical)" = "$(target_canonical)" ]; then \
65 echo runtest; \
66 else \
dcfff61f 67 t='$(program_transform_name)'; echo runtest | sed -e $$t; \
c906108c
SS
68 fi; \
69 fi`
70
71#### host, target, and site specific Makefile frags come in here.
72
73# The use of $$(x_FOR_TARGET) reduces the command line length by not
74# duplicating the lengthy definition.
75
76TARGET_FLAGS_TO_PASS = \
77 "prefix=$(prefix)" \
78 "exec_prefix=$(exec_prefix)" \
79 "against=$(against)" \
80 'CC=$$(CC_FOR_TARGET)' \
81 "CC_FOR_TARGET=$(CC_FOR_TARGET)" \
82 "CFLAGS=$(TESTSUITE_CFLAGS)" \
c906108c
SS
83 'CXX=$$(CXX_FOR_TARGET)' \
84 "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
85 "CXXFLAGS=$(CXXFLAGS)" \
86 "MAKEINFO=$(MAKEINFO)" \
87 "INSTALL=$(INSTALL)" \
88 "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
89 "INSTALL_DATA=$(INSTALL_DATA)" \
90 "LDFLAGS=$(LDFLAGS)" \
91 "LIBS=$(LIBS)" \
92 "RUNTEST=$(RUNTEST)" \
93 "RUNTESTFLAGS=$(RUNTESTFLAGS)"
94
2a31c623 95all: $(EXTRA_RULES)
c906108c
SS
96 @echo "Nothing to be done for all..."
97
98.NOEXPORT:
99INFODIRS=doc
100info:
101install-info:
102dvi:
9453113a
DJ
103pdf:
104install-pdf:
085dd6e6
JM
105html:
106install-html:
c906108c
SS
107
108install:
109
110uninstall: force
111
b8b4e42b
JK
112# Use absolute `site.exp' path everywhere to suppress VPATH lookups for it.
113# Bare `site.exp' is used as a target here if user requests it explicitly.
114# $(RUNTEST) is looking up `site.exp' only in the current directory.
115
116$(abs_builddir)/site.exp site.exp: ./config.status Makefile
c906108c
SS
117 @echo "Making a new config file..."
118 -@rm -f ./tmp?
119 @touch site.exp
120 -@mv site.exp site.bak
121 @echo "## these variables are automatically generated by make ##" > ./tmp0
122 @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
123 @echo "# add them to the last section" >> ./tmp0
c906108c
SS
124 @echo "set host_triplet ${host_canonical}" >> ./tmp0
125 @echo "set target_alias $(target_alias)" >> ./tmp0
126 @echo "set target_triplet ${target_canonical}" >> ./tmp0
127 @echo "set build_triplet ${build_canonical}" >> ./tmp0
128 @echo "set srcdir ${srcdir}" >> ./tmp0
129 @echo "set tool gdb" >> ./tmp0
f3525b70 130 @echo 'source $${srcdir}/lib/append_gdb_boards_dir.exp' >> ./tmp0
c906108c
SS
131 @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
132 @cat ./tmp0 > site.exp
133 @cat site.bak | sed \
134 -e '1,/^## All variables above are.*##/ d' >> site.exp
135 -@rm -f ./tmp?
136
137installcheck:
138
81208388
TT
139# See whether -j was given to make. Either it was given with no
140# arguments, and appears as "j" in the first word, or it was given an
141# argument and appears as "-j" in a separate word.
142@GMAKE_TRUE@saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j,$(MAKEFLAGS)))
143
144# For GNU make, try to run the tests in parallel if any -j option is
145# given. If RUNTESTFLAGS is not empty, then by default the tests will
146# be serialized. This can be overridden by setting FORCE_PARALLEL to
147# any non-empty value. For a non-GNU make, do not parallelize.
148@GMAKE_TRUE@CHECK_TARGET = $(if $(FORCE_PARALLEL),check-parallel,$(if $(RUNTESTFLAGS),check-single,$(if $(saw_dash_j),check-parallel,check-single)))
6bc80edc
TT
149@GMAKE_FALSE@CHECK_TARGET = check-single
150
81208388
TT
151# Note that we must resort to a recursive make invocation here,
152# because GNU make 3.82 has a bug preventing MAKEFLAGS from being used
153# in conditions.
154check: all $(abs_builddir)/site.exp
155 $(MAKE) $(CHECK_TARGET)
6bc80edc 156
2a31c623
PA
157check-read1:
158 $(MAKE) READ1="1" check
159
6bc80edc
TT
160# All the hair to invoke dejagnu. A given invocation can just append
161# $(RUNTESTFLAGS)
162DO_RUNTEST = \
c906108c
SS
163 rootme=`pwd`; export rootme; \
164 srcdir=${srcdir} ; export srcdir ; \
165 EXPECT=${EXPECT} ; export EXPECT ; \
93076499 166 EXEEXT=${EXEEXT} ; export EXEEXT ; \
c906108c
SS
167 $(RPATH_ENVVAR)=$$rootme/../../expect:$$rootme/../../libstdc++:$$rootme/../../tk/unix:$$rootme/../../tcl/unix:$$rootme/../../bfd:$$rootme/../../opcodes:$$$(RPATH_ENVVAR); \
168 export $(RPATH_ENVVAR); \
169 if [ -f $${rootme}/../../expect/expect ] ; then \
170 TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
171 export TCL_LIBRARY ; fi ; \
6bc80edc
TT
172 $(RUNTEST)
173
c17ef0d5
DE
174# TESTS exists for the user to pass on the command line to easily
175# say "Only run these tests." With check-single it's not necessary, but
176# with check-parallel there's no other way to (easily) specify a subset
177# of tests. For consistency we support it for check-single as well.
178# To specify all tests in a subdirectory, use TESTS=gdb.subdir/*.exp.
179# E.g., make check TESTS="gdb.server/*.exp gdb.threads/*.exp".
180@GMAKE_TRUE@TESTS :=
181@GMAKE_FALSE@TESTS =
182
183@GMAKE_TRUE@ifeq ($(strip $(TESTS)),)
184@GMAKE_TRUE@expanded_tests_or_none :=
185@GMAKE_TRUE@else
186@GMAKE_TRUE@expanded_tests := $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(TESTS))))
187@GMAKE_TRUE@expanded_tests_or_none := $(or $(expanded_tests),no-matching-tests-found)
188@GMAKE_TRUE@endif
189@GMAKE_FALSE@expanded_tests_or_none = $(TESTS)
190
81208388 191check-single:
c17ef0d5 192 $(DO_RUNTEST) $(RUNTESTFLAGS) $(expanded_tests_or_none)
6bc80edc 193
6bc80edc 194check-parallel:
5dd3176f 195 -rm -rf cache outputs temp
81208388 196 $(MAKE) -k do-check-parallel; \
6bc80edc 197 $(SHELL) $(srcdir)/dg-extract-results.sh \
81208388 198 `find outputs -name gdb.sum -print` > gdb.sum; \
6bc80edc 199 $(SHELL) $(srcdir)/dg-extract-results.sh -L \
81208388 200 `find outputs -name gdb.log -print` > gdb.log
496038b3 201 @sed -n '/=== gdb Summary ===/,$$ p' gdb.sum
81208388
TT
202
203# Turn a list of .exp files into "check/" targets. Only examine .exp
204# files appearing in a gdb.* directory -- we don't want to pick up
205# lib/ by mistake. For example, gdb.linespec/linespec.exp becomes
206# check/gdb.linespec/linespec.exp. The list is generally sorted
207# alphabetically, but we take a few tests known to be slow and push
208# them to the front of the list to try to lessen the overall time
209# taken by the test suite -- if one of these tests happens to be run
210# late, it will cause the overall time to increase.
c17ef0d5 211@GMAKE_TRUE@ifeq ($(strip $(TESTS)),)
81208388
TT
212slow_tests = gdb.base/break-interp.exp gdb.base/interp.exp \
213 gdb.base/multi-forks.exp
214@GMAKE_TRUE@all_tests := $(shell cd $(srcdir) && find gdb.* -name '*.exp' -print)
215@GMAKE_TRUE@reordered_tests := $(slow_tests) $(filter-out $(slow_tests),$(all_tests))
216@GMAKE_TRUE@TEST_TARGETS := $(addprefix check/,$(reordered_tests))
c17ef0d5
DE
217@GMAKE_TRUE@else
218@GMAKE_TRUE@TEST_TARGETS := $(addprefix check/,$(expanded_tests_or_none))
219@GMAKE_TRUE@endif
81208388
TT
220
221do-check-parallel: $(TEST_TARGETS)
222 @:
223
224@GMAKE_TRUE@check/%.exp:
225@GMAKE_TRUE@ -mkdir -p outputs/$*
226@GMAKE_TRUE@ @$(DO_RUNTEST) GDB_PARALLEL=yes --outdir=outputs/$* $*.exp $(RUNTESTFLAGS)
c906108c 227
c17ef0d5
DE
228check/no-matching-tests-found:
229 @echo ""
230 @echo "No matching tests found."
231 @echo ""
232
7636ccf9
YQ
233check-perf: all $(abs_builddir)/site.exp
234 @if test ! -d gdb.perf; then mkdir gdb.perf; fi
235 $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PERFTEST_MODE=both $(RUNTESTFLAGS)
236
c906108c
SS
237force:;
238
c906108c 239clean mostlyclean:
1d41d745
MS
240 -rm -f *~ core *.o a.out xgdb *.x *.grt bigcore.corefile .gdb_history
241 -rm -f core.* *.tf *.cl *.py tracecommandsscript copy1.txt zzz-gdbscript
957df313 242 -rm -f *.dwo *.dwp
81208388 243 -rm -rf outputs temp cache
2a31c623 244 -rm -f read1.so expect-read1
696d5a5b
DJ
245 if [ x"${ALL_SUBDIRS}" != x ] ; then \
246 for dir in ${ALL_SUBDIRS}; \
c906108c
SS
247 do \
248 echo "$$dir:"; \
249 if [ -d $$dir ]; then \
250 (cd $$dir; $(MAKE) clean); \
251 fi; \
252 done ; \
253 else true; fi
254
255distclean maintainer-clean realclean: clean
256 -rm -f *~ core
257 -rm -f Makefile config.status *-init.exp
258 -rm -fr *.log summary detail *.plog *.sum *.psum site.*
696d5a5b
DJ
259 if [ x"${ALL_SUBDIRS}" != x ] ; then \
260 for dir in ${ALL_SUBDIRS}; \
c906108c
SS
261 do \
262 echo "$$dir:"; \
263 if [ -d $$dir ]; then \
264 (cd $$dir; $(MAKE) distclean); \
265 fi; \
266 done ; \
267 else true; fi
268
a4ce5b0d 269Makefile : Makefile.in config.status $(host_makefile_frag)
c906108c
SS
270 $(SHELL) config.status
271
272config.status: configure
273 $(SHELL) config.status --recheck
6bf58e63
TT
274
275TAGS: force
967d1f9b
TT
276 find $(srcdir) -name '*.exp' -print | \
277 etags --regex='/proc[ \t]+\([^ \t]+\)/\1/' -
2a31c623
PA
278
279# Build the expect wrapper script that preloads the read1.so library.
280expect-read1:
281 @echo Making expect-read1
282 @rm -f expect-read1-tmp
283 @touch expect-read1-tmp
284 @echo "# THIS FILE IS GENERATED -*- buffer-read-only: t -*- \n" >>expect-read1-tmp
285 @echo "# vi:set ro: */\n\n" >>expect-read1-tmp
286 @echo "# To regenerate this file, run:\n" >>expect-read1-tmp
287 @echo "# make clean; make/\n" >>expect-read1-tmp
288 @echo "export LD_PRELOAD=`pwd`/read1.so" >>expect-read1-tmp
289 @echo 'exec expect "$$@"' >>expect-read1-tmp
290 @chmod +x expect-read1-tmp
291 @mv expect-read1-tmp expect-read1
292
293# Build the read1.so preload library. This overrides the `read'
294# function, making it read one byte at a time. Running the testsuite
295# with this catches racy tests.
296read1.so: lib/read1.c
297 $(CC) -o $@ ${srcdir}/lib/read1.c -Wall -g -shared -fPIC $(CFLAGS)
298
299# Build the read1 machinery.
300.PHONY: read1
301read1: read1.so expect-read1