source: trunk/essentials/sys-devel/automake-1.9/lib/am/dejagnu.am

Last change on this file was 3086, checked in by bird, 18 years ago

automake 1.9.6

File size: 4.0 KB
Line 
1## automake - create Makefile.in from Makefile.am
2## Copyright (C) 1994, 1995, 1996, 1997, 2000, 2001, 2003
3## Free Software Foundation, Inc.
4
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)
8## any later version.
9
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.
14
15## You should have received a copy of the GNU General Public License
16## along with this program; if not, write to the Free Software
17## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18## 02110-1301, USA.
19
20## Name of tool to use. Default is the same as the package.
21DEJATOOL = $(PACKAGE)
22
23## Default flags to pass to dejagnu. The user can override this.
24RUNTESTDEFAULTFLAGS = --tool $$tool --srcdir $$srcdir
25
26## In Cygnus mode, these are found in the build tree.
27## Otherwise they are looked for in $PATH.
28if %?CYGNUS%
29EXPECT = `if test -f $(top_builddir)/../expect/expect; then \
30 echo $(top_builddir)/../expect/expect; \
31 else \
32 echo expect; \
33 fi`
34
35RUNTEST = `if test -f $(top_srcdir)/../dejagnu/runtest; then \
36 echo $(top_srcdir)/../dejagnu/runtest; \
37 else \
38 echo runtest; \
39 fi`
40else ! %?CYGNUS%
41EXPECT = expect
42RUNTEST = runtest
43endif ! %?CYGNUS%
44
45
46.PHONY: check-DEJAGNU
47check-DEJAGNU: site.exp
48## Life is easiest with an absolute srcdir, so do that.
49 srcdir=`$(am__cd) $(srcdir) && pwd`; export srcdir; \
50 EXPECT=$(EXPECT); export EXPECT; \
51## Allow this to work when expect and DejaGnu are in tree.
52## Only required when --cygnus in force.
53?CYGNUS? if [ -f $(top_builddir)/../expect/expect ]; then \
54?CYGNUS? TCL_LIBRARY=`$(am__cd) $(top_srcdir)/../tcl/library && pwd`; \
55?CYGNUS? export TCL_LIBRARY; \
56?CYGNUS? fi; \
57 runtest=$(RUNTEST); \
58## If runtest can't be found, print a warning but don't die. It is
59## pointless to cause a failure if the tests cannot be run at all.
60 if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
61 l='$(DEJATOOL)'; for tool in $$l; do \
62 $$runtest $(AM_RUNTESTFLAGS) $(RUNTESTDEFAULTFLAGS) $(RUNTESTFLAGS); \
63 done; \
64 else echo "WARNING: could not find \`runtest'" 1>&2; :;\
65 fi
66
67
68## ------------------- ##
69## Building site.exp. ##
70## ------------------- ##
71
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.
75site.exp: Makefile
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 @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
90 @test ! -f site.exp || \
91 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
92 @-rm -f site.bak
93 @test ! -f site.exp || mv site.exp site.bak
94 @mv site.tmp site.exp
95
96## ---------- ##
97## Cleaning. ##
98## ---------- ##
99
100.PHONY distclean-am: distclean-DEJAGNU
101
102distclean-DEJAGNU:
103## Any other cleaning must be done by the user or by the test suite
104## itself. We can't predict what dejagnu or the test suite might
105## generate.
106 -rm -f site.exp site.bak
107 -l='$(DEJATOOL)'; for tool in $$l; do \
108 rm -f $$tool.sum $$tool.log; \
109 done
Note: See TracBrowser for help on using the repository browser.