1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2003, 2006, 2010
3 ## Free Software Foundation, Inc.
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 2, or (at your option)
10 ## This program is distributed in the hope that it will be useful,
11 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ## GNU General Public License for more details.
15 ## You should have received a copy of the GNU General Public License
16 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ## Name of tool to use. Default is the same as the package.
21 ## Default flags to pass to dejagnu. The user can override this.
22 RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
24 ## In Cygnus mode, these are found in the build tree.
25 ## Otherwise they are looked for in $PATH.
27 EXPECT = `if test -f $(top_builddir)/../expect/expect; then \
28 echo $(top_builddir)/../expect/expect; \
33 RUNTEST = `if test -f $(top_srcdir)/../dejagnu/runtest; then \
34 echo $(top_srcdir)/../dejagnu/runtest; \
45 check-DEJAGNU: site.exp
46 ## Life is easiest with an absolute srcdir, so do that.
47 srcdir='$(srcdir)'; export srcdir; \
48 EXPECT=$(EXPECT); export EXPECT; \
49 ## Allow this to work when expect and DejaGnu are in tree.
50 ## Only required when --cygnus in force.
51 ?CYGNUS? if [ -f $(top_builddir)/../expect/expect ]; then \
52 ?CYGNUS? TCL_LIBRARY=`$(am__cd) $(top_srcdir)/../tcl/library && pwd`; \
53 ?CYGNUS? export TCL_LIBRARY; \
56 ## If runtest can't be found, print a warning but don't die. It is
57 ## pointless to cause a failure if the tests cannot be run at all.
58 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
59 exit_status=0; l='$(DEJATOOL)'; for tool in $$l; do \
60 if $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
61 then :; else exit_status=1; fi; \
63 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
68 ## ------------------- ##
69 ## Building site.exp. ##
70 ## ------------------- ##
72 ## Note that in the rule we don't directly generate site.exp to avoid
73 ## the possibility of a corrupted site.exp if make is interrupted.
74 ## Jim Meyering has some useful text on this topic.
75 site.exp: Makefile $(EXTRA_DEJAGNU_SITE_CONFIG)
76 @echo 'Making a new site.exp file ...'
77 @echo '## these variables are automatically generated by make ##' >site.tmp
78 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
79 @echo '# edit the last section' >>site.tmp
80 @echo 'set srcdir "$(srcdir)"' >>site.tmp
81 @echo "set objdir `pwd`" >>site.tmp
82 ## Quote the *_alias variables because they might be empty.
83 ?BUILD? @echo 'set build_alias "$(build_alias)"' >>site.tmp
84 ?BUILD? @echo 'set build_triplet $(build_triplet)' >>site.tmp
85 ?HOST? @echo 'set host_alias "$(host_alias)"' >>site.tmp
86 ?HOST? @echo 'set host_triplet $(host_triplet)' >>site.tmp
87 ?TARGET? @echo 'set target_alias "$(target_alias)"' >>site.tmp
88 ?TARGET? @echo 'set target_triplet $(target_triplet)' >>site.tmp
89 ## Allow the package author to extend site.exp.
90 @list='$(EXTRA_DEJAGNU_SITE_CONFIG)'; for f in $$list; do \
91 echo "## Begin content included from file $$f. Do not modify. ##" \
92 && cat `test -f "$$f" || echo '$(srcdir)/'`$$f \
93 && echo "## End content included from file $$f. ##" \
96 @echo "## End of auto-generated content; you can edit from here. ##" >> site.tmp
97 @if test -f site.exp; then \
98 sed -e '1,/^## End of auto-generated content.*##/d' site.exp >> site.tmp; \
101 @test ! -f site.exp || mv site.exp site.bak
102 @mv site.tmp site.exp
108 .PHONY distclean-am: distclean-DEJAGNU
111 ## Any other cleaning must be done by the user or by the test suite
112 ## itself. We can't predict what dejagnu or the test suite might
114 -rm -f site.exp site.bak
115 -l='$(DEJATOOL)'; for tool in $$l; do \
116 rm -f $$tool.sum $$tool.log; \