maint: post-release: bump version to 1.16.93
[automake.git] / lib / am / dejagnu.am
blobc38ba631a09ba360e47b07e39b8eebea7511106d
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2024 Free Software Foundation, Inc.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <https://www.gnu.org/licenses/>.
17 ## Name of tool to use.  Default is the same as the package.
18 DEJATOOL = $(PACKAGE)
20 ## Default flags to pass to dejagnu.  The user can override this.
21 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
23 EXPECT = expect
24 RUNTEST = runtest
27 .PHONY: check-DEJAGNU
28 check-DEJAGNU: site.exp
29 ## Life is easiest with an absolute srcdir, so do that.
30         srcdir='$(srcdir)'; export srcdir; \
31         EXPECT=$(EXPECT); export EXPECT; \
32 ## If runtest can't be found, print a warning but don't die.  It is
33 ## pointless to cause a failure if the tests cannot be run at all.
34         if $(SHELL) -c "$(RUNTEST) --version" > /dev/null 2>&1; then \
35           exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
36             if $(RUNTEST) $(RUNTESTDEFAULTFLAGS) $(AM_RUNTESTFLAGS) $(RUNTESTFLAGS); \
37             then :; else exit_status=1; fi; \
38           done; \
39         else echo "WARNING: could not find '$(RUNTEST)'" 1>&2; :;\
40         fi; \
41         exit $$exit_status
44 ## ------------------- ##
45 ## Building site.exp.  ##
46 ## ------------------- ##
48 ## Note that in the rule we don't directly generate site.exp to avoid
49 ## the possibility of a corrupted site.exp if make is interrupted.
50 ## Jim Meyering has some useful text on this topic.
51 site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
52         $(AM_V_GEN)set -e; ( \
53         echo '## these variables are automatically generated by make ##'; \
54         echo '# Do not edit here.  If you wish to override these values'; \
55         echo '# edit the last section'; \
56         echo 'set srcdir "$(srcdir)"'; \
57         echo "set objdir \"`pwd`\""; \
58 ## Quote the *_alias variables because they might be empty.
59 ?BUILD? echo 'set build_alias "$(build_alias)"'; \
60 ?BUILD? echo 'set build_triplet $(build_triplet)'; \
61 ?HOST?  echo 'set host_alias "$(host_alias)"'; \
62 ?HOST?  echo 'set host_triplet $(host_triplet)'; \
63 ?TARGET?        echo 'set target_alias "$(target_alias)"'; \
64 ?TARGET?        echo 'set target_triplet $(target_triplet)'; \
65 ## Allow the package author to extend site.exp.
66         list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; \
67         for f in $$list; do \
68           echo "## Begin content included from file $$f.  Do not modify. ##"; \
69           cat `test -f "$$f" || echo '$(srcdir)/'`$$f; \
70           echo "## End content included from file $$f. ##"; \
71         done; \
72         echo "## End of auto-generated content; you can edit from here. ##"; \
73         if test -f site.exp; then \
74           sed -e '1,/^## End of auto-generated content.*##/d' site.exp; \
75         fi; \
76         ) >site.tmp; \
77         rm -f site.bak; \
78         test ! -f site.exp || mv site.exp site.bak; \
79         mv site.tmp site.exp
81 ## ---------- ##
82 ## Cleaning.  ##
83 ## ---------- ##
85 .PHONY distclean-am: distclean-DEJAGNU
87 distclean-DEJAGNU:
88 ## Any other cleaning must be done by the user or by the test suite
89 ## itself.  We can't predict what dejagnu or the test suite might
90 ## generate.
91         -rm -f site.exp site.bak
92         -l='$(DEJATOOL)'; for tool in $$l; do \
93           rm -f $$tool.sum $$tool.log; \
94         done