]>
Commit | Line | Data |
---|---|---|
c906108c | 1 | # Makefile for regression testing the GNU debugger. |
213516ef | 2 | # Copyright 1992-2023 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 | |
19 | VPATH = @srcdir@ | |
20 | srcdir = @srcdir@ | |
21 | prefix = @prefix@ | |
22 | exec_prefix = @exec_prefix@ | |
b8b4e42b | 23 | abs_builddir = @abs_builddir@ |
437277d4 | 24 | abs_srcdir = @abs_srcdir@ |
c906108c | 25 | |
be2a5f71 | 26 | target_alias = @target_noncanonical@ |
c906108c SS |
27 | program_transform_name = @program_transform_name@ |
28 | build_canonical = @build@ | |
29 | host_canonical = @host@ | |
30 | target_canonical = @target@ | |
1776e3e5 | 31 | enable_libctf = @enable_libctf@ |
c906108c SS |
32 | |
33 | SHELL = @SHELL@ | |
93076499 | 34 | EXEEXT = @EXEEXT@ |
c906108c SS |
35 | SUBDIRS = @subdirs@ |
36 | RPATH_ENVVAR = @RPATH_ENVVAR@ | |
37 | ||
2a31c623 PA |
38 | CC=@CC@ |
39 | ||
40 | EXPECT = `if [ "$${READ1}" != "" ] ; then \ | |
41 | echo $${rootme}/expect-read1; \ | |
fa9ce2c1 TV |
42 | elif [ "$${READMORE}" != "" ] ; then \ |
43 | echo $${rootme}/expect-readmore; \ | |
2a31c623 PA |
44 | elif [ -f $${rootme}/../../expect/expect ] ; then \ |
45 | echo $${rootme}/../../expect/expect ; \ | |
46 | else \ | |
47 | echo expect ; \ | |
48 | fi` | |
c906108c SS |
49 | |
50 | RUNTEST = $(RUNTEST_FOR_TARGET) | |
51 | ||
52 | RUNTESTFLAGS = | |
53 | ||
6bc80edc TT |
54 | FORCE_PARALLEL = |
55 | ||
29b52314 | 56 | GDB_DEBUG = |
dd06d4d6 AH |
57 | GDBSERVER_DEBUG = |
58 | ||
fb6a751f SDJ |
59 | # Default number of iterations that we will use to run the testsuite |
60 | # if the user does not specify the RACY_ITER environment variable | |
61 | # (e.g., when the user calls the make rule directly from the command | |
62 | # line). | |
63 | DEFAULT_RACY_ITER = 3 | |
64 | ||
c906108c SS |
65 | RUNTEST_FOR_TARGET = `\ |
66 | if [ -f $${srcdir}/../../dejagnu/runtest ]; then \ | |
67 | echo $${srcdir}/../../dejagnu/runtest; \ | |
68 | else \ | |
69 | if [ "$(host_canonical)" = "$(target_canonical)" ]; then \ | |
70 | echo runtest; \ | |
71 | else \ | |
dcfff61f | 72 | t='$(program_transform_name)'; echo runtest | sed -e $$t; \ |
c906108c SS |
73 | fi; \ |
74 | fi` | |
75 | ||
76 | #### host, target, and site specific Makefile frags come in here. | |
77 | ||
78 | # The use of $$(x_FOR_TARGET) reduces the command line length by not | |
79 | # duplicating the lengthy definition. | |
80 | ||
81 | TARGET_FLAGS_TO_PASS = \ | |
82 | "prefix=$(prefix)" \ | |
83 | "exec_prefix=$(exec_prefix)" \ | |
84 | "against=$(against)" \ | |
85 | 'CC=$$(CC_FOR_TARGET)' \ | |
86 | "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ | |
87 | "CFLAGS=$(TESTSUITE_CFLAGS)" \ | |
c906108c SS |
88 | 'CXX=$$(CXX_FOR_TARGET)' \ |
89 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ | |
90 | "CXXFLAGS=$(CXXFLAGS)" \ | |
91 | "MAKEINFO=$(MAKEINFO)" \ | |
92 | "INSTALL=$(INSTALL)" \ | |
93 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
94 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
95 | "LDFLAGS=$(LDFLAGS)" \ | |
96 | "LIBS=$(LIBS)" \ | |
97 | "RUNTEST=$(RUNTEST)" \ | |
98 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" | |
99 | ||
f99d1d37 | 100 | all: |
2adf1781 | 101 | @: |
c906108c SS |
102 | |
103 | .NOEXPORT: | |
104 | INFODIRS=doc | |
105 | info: | |
106 | install-info: | |
107 | dvi: | |
9453113a DJ |
108 | pdf: |
109 | install-pdf: | |
085dd6e6 JM |
110 | html: |
111 | install-html: | |
c906108c SS |
112 | |
113 | install: | |
114 | ||
115 | uninstall: force | |
116 | ||
b8b4e42b JK |
117 | # Use absolute `site.exp' path everywhere to suppress VPATH lookups for it. |
118 | # Bare `site.exp' is used as a target here if user requests it explicitly. | |
119 | # $(RUNTEST) is looking up `site.exp' only in the current directory. | |
120 | ||
f99d1d37 | 121 | $(abs_builddir)/site.exp site.exp: Makefile |
2adf1781 TT |
122 | $(ECHO_GEN) \ |
123 | rm -f ./tmp?; \ | |
124 | touch site.exp; \ | |
125 | mv site.exp site.bak; \ | |
126 | echo "## these variables are automatically generated by make ##" > ./tmp0; \ | |
127 | echo "# Do not edit here. If you wish to override these values" >> ./tmp0; \ | |
128 | echo "# add them to the last section" >> ./tmp0; \ | |
129 | echo "set host_triplet ${host_canonical}" >> ./tmp0; \ | |
130 | echo "set target_alias $(target_alias)" >> ./tmp0; \ | |
131 | echo "set target_triplet ${target_canonical}" >> ./tmp0; \ | |
132 | echo "set build_triplet ${build_canonical}" >> ./tmp0; \ | |
133 | echo "set srcdir ${abs_srcdir}" >> ./tmp0; \ | |
134 | echo "set tool gdb" >> ./tmp0; \ | |
135 | echo "set enable_libctf ${enable_libctf}" >> ./tmp0; \ | |
136 | echo 'source $${srcdir}/lib/append_gdb_boards_dir.exp' >> ./tmp0; \ | |
137 | echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0; \ | |
138 | cat ./tmp0 > site.exp; \ | |
139 | cat site.bak | sed \ | |
140 | -e '1,/^## All variables above are.*##/ d' >> site.exp; \ | |
141 | rm -f ./tmp? | |
c906108c SS |
142 | |
143 | installcheck: | |
144 | ||
96d68bd4 RO |
145 | # See whether -j was given to make. Before GNU make 4.2, either it was |
146 | # given with no arguments, and appears as "j" in the first word, or it was | |
147 | # given an argument and appears as "-j" in a separate word. Starting with | |
148 | # GNU make 4.2, it always appears as "-j"/"-jN" in a separate word. | |
149 | saw_dash_j = $(or $(findstring j,$(firstword $(MAKEFLAGS))),$(filter -j%,$(MAKEFLAGS))) | |
81208388 | 150 | |
3b165252 SM |
151 | # Try to run the tests in parallel if any -j option is given. If RUNTESTFLAGS |
152 | # is not empty, then by default the tests will be serialized. This can be | |
153 | # overridden by setting FORCE_PARALLEL to any non-empty value. | |
154 | CHECK_TARGET_TMP = $(if $(FORCE_PARALLEL),check-parallel,$(if $(RUNTESTFLAGS),check-single,$(if $(saw_dash_j),check-parallel,check-single))) | |
155 | CHECK_TARGET = $(if $(RACY_ITER),$(addsuffix -racy,$(CHECK_TARGET_TMP)),$(CHECK_TARGET_TMP)) | |
6bc80edc | 156 | |
81208388 TT |
157 | # Note that we must resort to a recursive make invocation here, |
158 | # because GNU make 3.82 has a bug preventing MAKEFLAGS from being used | |
159 | # in conditions. | |
160 | check: all $(abs_builddir)/site.exp | |
161 | $(MAKE) $(CHECK_TARGET) | |
6bc80edc | 162 | |
f99d1d37 | 163 | check-read1: read1.so expect-read1 |
2a31c623 PA |
164 | $(MAKE) READ1="1" check |
165 | ||
fa9ce2c1 TV |
166 | check-readmore: readmore.so expect-readmore |
167 | $(MAKE) READMORE="1" check | |
168 | ||
f63c03b4 SDJ |
169 | # Check whether we need to print the timestamp for each line of |
170 | # status. | |
171 | TIMESTAMP = $(if $(TS),| $(srcdir)/print-ts.py $(if $(TS_FORMAT),$(TS_FORMAT),),) | |
172 | ||
29b52314 | 173 | gdb_debug = $(if $(GDB_DEBUG),GDB_DEBUG=$(GDB_DEBUG) ; export GDB_DEBUG ;,) |
dd06d4d6 AH |
174 | gdbserver_debug = $(if $(GDBSERVER_DEBUG),GDBSERVER_DEBUG=$(GDBSERVER_DEBUG) ; export GDBSERVER_DEBUG ;,) |
175 | ||
29b52314 | 176 | |
6bc80edc TT |
177 | # All the hair to invoke dejagnu. A given invocation can just append |
178 | # $(RUNTESTFLAGS) | |
179 | DO_RUNTEST = \ | |
c906108c SS |
180 | rootme=`pwd`; export rootme; \ |
181 | srcdir=${srcdir} ; export srcdir ; \ | |
182 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
29b52314 | 183 | EXEEXT=${EXEEXT} ; export EXEEXT ; $(gdb_debug) $(gdbserver_debug) \ |
c906108c SS |
184 | $(RPATH_ENVVAR)=$$rootme/../../expect:$$rootme/../../libstdc++:$$rootme/../../tk/unix:$$rootme/../../tcl/unix:$$rootme/../../bfd:$$rootme/../../opcodes:$$$(RPATH_ENVVAR); \ |
185 | export $(RPATH_ENVVAR); \ | |
186 | if [ -f $${rootme}/../../expect/expect ] ; then \ | |
187 | TCL_LIBRARY=$${srcdir}/../../tcl/library ; \ | |
188 | export TCL_LIBRARY ; fi ; \ | |
41d1845e | 189 | $(RUNTEST) --status |
6bc80edc | 190 | |
c17ef0d5 DE |
191 | # TESTS exists for the user to pass on the command line to easily |
192 | # say "Only run these tests." With check-single it's not necessary, but | |
193 | # with check-parallel there's no other way to (easily) specify a subset | |
194 | # of tests. For consistency we support it for check-single as well. | |
195 | # To specify all tests in a subdirectory, use TESTS=gdb.subdir/*.exp. | |
196 | # E.g., make check TESTS="gdb.server/*.exp gdb.threads/*.exp". | |
3b165252 | 197 | TESTS := |
c17ef0d5 | 198 | |
3b165252 SM |
199 | ifeq ($(strip $(TESTS)),) |
200 | expanded_tests_or_none := | |
201 | else | |
202 | expanded_tests := $(patsubst $(srcdir)/%,%,$(wildcard $(addprefix $(srcdir)/,$(TESTS)))) | |
203 | expanded_tests_or_none := $(or $(expanded_tests),no-matching-tests-found) | |
204 | endif | |
c17ef0d5 | 205 | |
c3d64d46 AB |
206 | # With check-single, if TESTS was expanded to "no-matching-tests-found" then |
207 | # this will be passed to DejaGnu, resuling in an error. With check-parallel | |
208 | # in the same situation, we avoid invoking DejaGnu, and instead just call | |
209 | # the check/no-matching-tests-found rule (which prints a helpful message). | |
210 | # | |
211 | # To get the same behaviour for check-single we decide here, based on how | |
212 | # TESTS expanded, whether check-single should redirect to do-check-single or | |
213 | # to check/no-matching-tests-found. | |
214 | ifeq ($(expanded_tests_or_none),no-matching-tests-found) | |
215 | CHECK_SINGLE_DEP=check/no-matching-tests-found | |
216 | else | |
217 | CHECK_SINGLE_DEP=do-check-single | |
218 | endif | |
219 | ||
4992aa20 | 220 | # Shorthand for running all the tests in a single directory. |
3b165252 SM |
221 | check-gdb.%: |
222 | $(MAKE) check TESTS="gdb.$*/*.exp" | |
4992aa20 | 223 | |
c3d64d46 AB |
224 | do-check-single: |
225 | -rm -f *core* gdb.sum gdb.log | |
e83907ff PA |
226 | $(DO_RUNTEST) $(RUNTESTFLAGS) $(expanded_tests_or_none) $(TIMESTAMP); \ |
227 | result=$$?; \ | |
c3d64d46 AB |
228 | if test -e gdb.sum; then \ |
229 | $(SHELL) $(srcdir)/lib/dg-add-core-file-count.sh; \ | |
230 | sed -n '/=== gdb Summary ===/,$$ p' gdb.sum; \ | |
231 | fi; \ | |
e83907ff | 232 | exit $$result |
6bc80edc | 233 | |
c3d64d46 AB |
234 | check-single: $(CHECK_SINGLE_DEP) |
235 | ||
fb6a751f SDJ |
236 | check-single-racy: |
237 | -rm -rf cache racy_outputs temp | |
238 | mkdir -p racy_outputs; \ | |
239 | racyiter="$(RACY_ITER)"; \ | |
0db49895 | 240 | test "x$$racyiter" = "x" && \ |
fb6a751f SDJ |
241 | racyiter=$(DEFAULT_RACY_ITER); \ |
242 | if test $$racyiter -lt 2 ; then \ | |
243 | echo "RACY_ITER must be at least 2."; \ | |
244 | exit 1; \ | |
245 | fi; \ | |
246 | trap "exit" INT; \ | |
247 | for n in `seq $$racyiter` ; do \ | |
248 | mkdir -p racy_outputs/$$n; \ | |
249 | $(DO_RUNTEST) --outdir=racy_outputs/$$n $(RUNTESTFLAGS) \ | |
f63c03b4 | 250 | $(expanded_tests_or_none) $(TIMESTAMP); \ |
fb6a751f SDJ |
251 | done; \ |
252 | $(srcdir)/analyze-racy-logs.py \ | |
253 | `ls racy_outputs/*/gdb.sum` > racy.sum; \ | |
254 | sed -n '/=== gdb Summary ===/,$$ p' racy.sum | |
255 | ||
6bc80edc | 256 | check-parallel: |
e83907ff | 257 | -rm -f *core* |
5dd3176f | 258 | -rm -rf cache outputs temp |
81208388 | 259 | $(MAKE) -k do-check-parallel; \ |
bef95aac | 260 | result=$$?; \ |
c3d64d46 AB |
261 | if test -d outputs; then \ |
262 | $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \ | |
263 | `find outputs -name gdb.sum -print` > gdb.sum; \ | |
264 | $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \ | |
265 | `find outputs -name gdb.log -print` > gdb.log; \ | |
266 | $(SHELL) $(srcdir)/lib/dg-add-core-file-count.sh; \ | |
267 | sed -n '/=== gdb Summary ===/,$$ p' gdb.sum; \ | |
268 | fi; \ | |
bef95aac | 269 | exit $$result |
81208388 | 270 | |
fb6a751f SDJ |
271 | check-parallel-racy: |
272 | -rm -rf cache racy_outputs temp | |
273 | racyiter="$(RACY_ITER)"; \ | |
0db49895 | 274 | test "x$$racyiter" = "x" && \ |
fb6a751f SDJ |
275 | racyiter=$(DEFAULT_RACY_ITER); \ |
276 | if test $$racyiter -lt 2 ; then \ | |
277 | echo "RACY_ITER must be at least 2."; \ | |
278 | exit 1; \ | |
279 | fi; \ | |
280 | trap "exit" INT; \ | |
281 | for n in `seq $$racyiter` ; do \ | |
282 | $(MAKE) -k do-check-parallel-racy \ | |
283 | RACY_OUTPUT_N=$$n; \ | |
5a699617 | 284 | $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh \ |
fb6a751f SDJ |
285 | `find racy_outputs/$$n -name gdb.sum -print` > \ |
286 | racy_outputs/$$n/gdb.sum; \ | |
6f1107b5 | 287 | $(SHELL) $(srcdir)/../../contrib/dg-extract-results.sh -L \ |
fb6a751f SDJ |
288 | `find racy_outputs/$$n -name gdb.log -print` > \ |
289 | racy_outputs/$$n/gdb.log; \ | |
290 | sed -n '/=== gdb Summary ===/,$$ p' racy_outputs/$$n/gdb.sum; \ | |
291 | done; \ | |
292 | $(srcdir)/analyze-racy-logs.py \ | |
293 | `ls racy_outputs/*/gdb.sum` > racy.sum; \ | |
294 | sed -n '/=== gdb Summary ===/,$$ p' racy.sum | |
295 | ||
81208388 TT |
296 | # Turn a list of .exp files into "check/" targets. Only examine .exp |
297 | # files appearing in a gdb.* directory -- we don't want to pick up | |
298 | # lib/ by mistake. For example, gdb.linespec/linespec.exp becomes | |
299 | # check/gdb.linespec/linespec.exp. The list is generally sorted | |
300 | # alphabetically, but we take a few tests known to be slow and push | |
301 | # them to the front of the list to try to lessen the overall time | |
302 | # taken by the test suite -- if one of these tests happens to be run | |
303 | # late, it will cause the overall time to increase. | |
3b165252 | 304 | ifeq ($(strip $(TESTS)),) |
81208388 TT |
305 | slow_tests = gdb.base/break-interp.exp gdb.base/interp.exp \ |
306 | gdb.base/multi-forks.exp | |
3b165252 SM |
307 | all_tests := $(shell cd $(srcdir) && find gdb.* -name '*.exp' -print) |
308 | reordered_tests := $(slow_tests) $(filter-out $(slow_tests),$(all_tests)) | |
309 | TEST_TARGETS := $(addprefix $(if $(RACY_ITER),check-racy,check)/,$(reordered_tests)) | |
310 | else | |
311 | TEST_TARGETS := $(addprefix $(if $(RACY_ITER),check-racy,check)/,$(expanded_tests_or_none)) | |
312 | endif | |
81208388 TT |
313 | |
314 | do-check-parallel: $(TEST_TARGETS) | |
315 | @: | |
316 | ||
3b165252 SM |
317 | check/%.exp: |
318 | -mkdir -p outputs/$* | |
f63c03b4 | 319 | @$(DO_RUNTEST) GDB_PARALLEL=yes --outdir=outputs/$* $*.exp $(RUNTESTFLAGS) $(TIMESTAMP) |
c906108c | 320 | |
fb6a751f SDJ |
321 | do-check-parallel-racy: $(TEST_TARGETS) |
322 | @: | |
323 | ||
3b165252 SM |
324 | check-racy/%.exp: |
325 | -mkdir -p racy_outputs/$(RACY_OUTPUT_N)/$* | |
326 | $(DO_RUNTEST) GDB_PARALLEL=yes \ | |
327 | --outdir=racy_outputs/$(RACY_OUTPUT_N)/$* $*.exp \ | |
f63c03b4 | 328 | $(RUNTESTFLAGS) $(TIMESTAMP) |
fb6a751f | 329 | |
c17ef0d5 DE |
330 | check/no-matching-tests-found: |
331 | @echo "" | |
332 | @echo "No matching tests found." | |
333 | @echo "" | |
334 | ||
3d338901 | 335 | # Utility rule invoked by step 2 of the build-perf rule. |
3b165252 SM |
336 | workers/%.worker: |
337 | mkdir -p gdb.perf/outputs/$* | |
f63c03b4 | 338 | $(DO_RUNTEST) --outdir=gdb.perf/outputs/$* lib/build-piece.exp WORKER=$* GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=build-pieces $(TIMESTAMP) |
3d338901 DE |
339 | |
340 | # Utility rule to build tests that support it in parallel. | |
341 | # The build is broken into 3 steps distinguished by GDB_PERFTEST_SUBMODE: | |
342 | # gen-workers, build-pieces, final. | |
343 | # | |
344 | # GDB_PERFTEST_MODE appears *after* RUNTESTFLAGS here because we don't want | |
345 | # anything in RUNTESTFLAGS to override it. | |
346 | # | |
347 | # We don't delete the outputs directory here as these programs can take | |
348 | # awhile to build, and perftest.exp has support for deciding whether to | |
349 | # recompile them. If you want to remove these directories, make clean. | |
350 | # | |
351 | # The point of step 1 is to construct the set of worker tasks for step 2. | |
352 | # All of the information needed by build-piece.exp is contained in the name | |
353 | # of the generated .worker file. | |
3b165252 SM |
354 | build-perf: $(abs_builddir)/site.exp |
355 | rm -rf gdb.perf/workers | |
356 | mkdir -p gdb.perf/workers | |
357 | @: Step 1: Generate the build .worker files. | |
f63c03b4 | 358 | $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf/workers GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=gen-workers $(TIMESTAMP) |
3b165252 SM |
359 | @: Step 2: Compile the pieces. Here is the build parallelism. |
360 | $(MAKE) $$(cd gdb.perf && echo workers/*/*.worker) | |
361 | @: Step 3: Do the final link. | |
f63c03b4 | 362 | $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PARALLEL=gdb.perf $(RUNTESTFLAGS) GDB_PERFTEST_MODE=compile GDB_PERFTEST_SUBMODE=final $(TIMESTAMP) |
3d338901 DE |
363 | |
364 | # The default is to both compile and run the tests. | |
365 | GDB_PERFTEST_MODE = both | |
366 | ||
7636ccf9 YQ |
367 | check-perf: all $(abs_builddir)/site.exp |
368 | @if test ! -d gdb.perf; then mkdir gdb.perf; fi | |
f63c03b4 | 369 | $(DO_RUNTEST) --directory=gdb.perf --outdir gdb.perf GDB_PERFTEST_MODE=$(GDB_PERFTEST_MODE) $(RUNTESTFLAGS) $(TIMESTAMP) |
7636ccf9 | 370 | |
e5f1ee18 AB |
371 | |
372 | check-all-boards: all $(abs_builddir)/site.exp | |
373 | @if [ -z "$(GDB_TARGET_USERNAME)" ]; then \ | |
374 | echo "Must define GDB_TARGET_USERNAME"; \ | |
375 | false; \ | |
376 | fi | |
377 | @if [ -z "$(GDB_HOST_USERNAME)" ]; then \ | |
378 | echo "Must define GDB_HOST_USERNAME"; \ | |
379 | false; \ | |
380 | fi | |
381 | @if [ -z "$(TESTS)" ]; then \ | |
382 | echo "Must define TESTS"; \ | |
383 | false; \ | |
384 | fi | |
385 | ${abs_srcdir}/make-check-all.sh --keep-results \ | |
386 | --host-user "$(GDB_HOST_USERNAME)" \ | |
387 | --target-user "$(GDB_TARGET_USERNAME)" \ | |
388 | "$(TESTS)" | |
389 | ||
c906108c SS |
390 | force:; |
391 | ||
c906108c | 392 | clean mostlyclean: |
1d41d745 | 393 | -rm -f *~ core *.o a.out xgdb *.x *.grt bigcore.corefile .gdb_history |
576fd14c | 394 | -rm -f core.* *.tf *.cl tracecommandsscript copy1.txt zzz-gdbscript |
957df313 | 395 | -rm -f *.dwo *.dwp |
81208388 | 396 | -rm -rf outputs temp cache |
3d338901 | 397 | -rm -rf gdb.perf/workers gdb.perf/outputs gdb.perf/temp gdb.perf/cache |
fa9ce2c1 | 398 | -rm -f read1.so expect-read1 readmore.so expect-readmore |
c906108c SS |
399 | |
400 | distclean maintainer-clean realclean: clean | |
401 | -rm -f *~ core | |
c675db74 | 402 | -rm -f Makefile config.status *-init.exp lib/pdtrace |
c906108c | 403 | -rm -fr *.log summary detail *.plog *.sum *.psum site.* |
c906108c | 404 | |
a100a945 SM |
405 | Makefile : Makefile.in config.status $(host_makefile_frag) |
406 | $(SHELL) config.status Makefile | |
c906108c | 407 | |
a100a945 SM |
408 | lib/pdtrace: pdtrace.in config.status |
409 | $(SHELL) config.status lib/pdtrace | |
410 | ||
411 | config.status: configure | |
412 | $(SHELL) config.status --recheck | |
6bf58e63 TT |
413 | |
414 | TAGS: force | |
967d1f9b | 415 | find $(srcdir) -name '*.exp' -print | \ |
2361b0fb TT |
416 | etags \ |
417 | --regex='/\(proc\|proc_with_prefix\|gdb_caching_proc\)[ \t]+\([^ \t]+\)/\2/' \ | |
418 | - | |
2a31c623 PA |
419 | |
420 | # Build the expect wrapper script that preloads the read1.so library. | |
fa9ce2c1 | 421 | expect-read1 expect-readmore: |
2adf1781 | 422 | $(ECHO_GEN) \ |
fa9ce2c1 TV |
423 | rm -f $@-tmp; \ |
424 | touch $@-tmp; \ | |
425 | echo "# THIS FILE IS GENERATED -*- buffer-read-only: t -*- \n" >>$@-tmp; \ | |
426 | echo "# vi:set ro: */\n\n" >>$@-tmp; \ | |
427 | echo "# To regenerate this file, run:\n" >>$@-tmp; \ | |
428 | echo "# make clean; make/\n" >>$@-tmp; \ | |
429 | if [ $@ = expect-read1 ]; then \ | |
430 | echo "export LD_PRELOAD=`pwd`/read1.so" >>$@-tmp; \ | |
431 | else \ | |
432 | echo "export LD_PRELOAD=`pwd`/readmore.so" >>$@-tmp; \ | |
433 | fi; \ | |
434 | echo 'exec expect "$$@"' >>$@-tmp; \ | |
435 | chmod +x $@-tmp; \ | |
436 | mv $@-tmp $@ | |
2a31c623 PA |
437 | |
438 | # Build the read1.so preload library. This overrides the `read' | |
439 | # function, making it read one byte at a time. Running the testsuite | |
440 | # with this catches racy tests. | |
441 | read1.so: lib/read1.c | |
2adf1781 | 442 | $(ECHO_CC) $(CC) -o $@ ${srcdir}/lib/read1.c -Wall -g -shared -fPIC $(CFLAGS) |
2a31c623 | 443 | |
fa9ce2c1 TV |
444 | # Build the readmore.so preload library. This overrides the `read' |
445 | # function, making it try harder to read more at a time. Running the | |
446 | # testsuite with this catches racy tests. | |
447 | readmore.so: lib/read1.c | |
448 | $(ECHO_CC) $(CC) -o $@ ${srcdir}/lib/read1.c -Wall -g -shared -fPIC \ | |
449 | $(CFLAGS) -DREADMORE | |
450 | ||
2a31c623 | 451 | # Build the read1 machinery. |
fa9ce2c1 | 452 | .PHONY: read1 readmore |
2a31c623 | 453 | read1: read1.so expect-read1 |
fa9ce2c1 | 454 | readmore: readmore.so expect-readmore |
ad02e4fe SM |
455 | |
456 | # Disable implicit make rules. | |
457 | include $(srcdir)/../disable-implicit-rules.mk | |
2adf1781 | 458 | include $(srcdir)/../silent-rules.mk |