1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2012 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)
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 <http://www.gnu.org/licenses/>.
17 ## Name of tool to use. Default is the same as the package.
20 ## Default flags to pass to dejagnu. The user can override this.
21 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
23 ## In Cygnus mode, these are found in the build tree.
24 ## Otherwise they are looked for in $PATH.
26 EXPECT = `if test -f $(top_builddir)/../expect/expect; then \
27 echo $(top_builddir)/../expect/expect; \
32 RUNTEST = `if test -f $(top_srcdir)/../dejagnu/runtest; then \
33 echo $(top_srcdir)/../dejagnu/runtest; \
44 check-DEJAGNU: site.exp
45 ## Life is easiest with an absolute srcdir, so do that.
46 srcdir='$(srcdir)'; export srcdir; \
47 EXPECT=$(EXPECT); export EXPECT; \
48 ## Allow this to work when expect and DejaGnu are in tree.
49 ## Only required when --cygnus in force.
50 ?CYGNUS? if [ -f $(top_builddir)/../expect/expect ]; then \
51 ?CYGNUS? TCL_LIBRARY=`$(am__cd) $(top_srcdir)/../tcl/library && pwd`; \
52 ?CYGNUS? export TCL_LIBRARY; \
55 ## If runtest can't be found, print a warning but don't die. It is
56 ## pointless to cause a failure if the tests cannot be run at all.
57 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
58 exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
59 if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
60 then :; else exit_status=1; fi; \
62 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
67 ## ------------------- ##
68 ## Building site.exp. ##
69 ## ------------------- ##
71 ## Note that in the rule we don't directly generate site.exp to avoid
72 ## the possibility of a corrupted site.exp if make is interrupted.
73 ## Jim Meyering has some useful text on this topic.
74 site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
75 @echo 'Making a new site.exp file ...'
76 @echo '## these variables are automatically generated by make ##' >site.tmp
77 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
78 @echo '# edit the last section' >>site.tmp
79 @echo 'set srcdir "$(srcdir)"' >>site.tmp
80 @echo "set objdir `pwd`" >>site.tmp
81 ## Quote the *_alias variables because they might be empty.
82 ?BUILD? @echo 'set build_alias "$(build_alias)"' >>site.tmp
83 ?BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp
84 ?HOST? @echo 'set host_alias "$(host_alias)"' >>site.tmp
85 ?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp
86 ?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp
87 ?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp
88 ## Allow the package author to extend site.exp.
89 @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
90 echo "## Begin content included from file $$f. Do not modify. ##" \
91 && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
92 && echo "## End content included from file $$f. ##" \
95 @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
96 @if test -f site.exp; then \
97 sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
100 @test ! -f site.exp || mv site.exp site.bak
101 @mv site.tmp site.exp
107 .PHONY distclean-am: distclean-DEJAGNU
110 ## Any other cleaning must be done by the user or by the test suite
111 ## itself. We can't predict what dejagnu or the test suite might
113 -rm -f site.exp site.bak
114 -l='$(DEJATOOL)'; for tool in $$l; do \
115 rm -f $$tool.sum $$tool.log; \