1 ## Process this file with automake to create Makefile.in. -*-Makefile-*-
3 ## Makefile for Autoconf testsuite.
4 ## Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 2, or (at your option)
11 ## This program is distributed in the hope that it will be useful,
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.
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program; if not, write to the Free Software
18 ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 # We don't actually distribute the testsuite, since one only
22 # needs m4 to build it, m4 being required anyway to install Autoconf.
23 EXTRA_DIST = $(TESTSUITE_AT) local.at mktests.sh \
24 atlocal.in package.m4 wrapper.as
26 # Running the uninstalled scripts.
27 check_SCRIPTS = autoconf autoheader autoreconf autom4te autoscan autoupdate ifnames
29 DISTCLEANFILES = atconfig atlocal $(TESTSUITE) $(check_SCRIPTS)
31 # Import the dependencies on Autotest and M4sh.
32 include ../lib/freeze.mk
39 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
41 echo '# Signature of the current package.'; \
42 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
43 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
44 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
45 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
46 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
47 } >$(srcdir)/package.m4
55 $(srcdir)/wrapper.in: $(srcdir)/wrapper.as
56 ./autom4te --language=M4sh $(srcdir)/wrapper.as -o $@
64 TESTSUITE_GENERATED_AT = \
65 aclang.at acc.at acfortran.at \
66 acgeneral.at acstatus.at \
67 acautoheader.at acautoupdate.at \
68 acspecific.at acfunctions.at acheaders.at actypes.at \
69 aclibs.at acprograms.at
74 base.at tools.at torture.at \
75 compile.at c.at fortran.at \
79 TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT)
80 TESTSUITE = ./testsuite
82 # Run the non installed autom4te.
83 # Don't use AUTOM4TE since `make alpha' makes it unavailable although
84 # we are allowed to use it (since we ship it).
85 AUTOTEST = ./autom4te --language=autotest
86 $(TESTSUITE): $(srcdir)/package.m4 \
89 $(autotest_m4f_dependencies)
90 $(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp
93 atconfig: $(top_builddir)/config.status
94 cd $(top_builddir) && ./config.status tests/$@
97 test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
99 rm -f -r autom4te.cache
101 check-local: atconfig atlocal $(TESTSUITE)
102 $(SHELL) $(TESTSUITE)
104 # Run the test suite on the *installed* tree.
106 $(SHELL) $(TESTSUITE) AUTOTEST_PATH=$(exec_prefix)/bin
110 ## ------------------ ##
111 ## Maintainer rules. ##
112 ## ------------------ ##
114 MAINTAINERCLEANFILES = Makefile.in $(TESTSUITE_GENERATED_AT)
116 ## Producing the test files.
118 # The files which contains macro we check for syntax. Don't use $(top_srcdir)
119 # here since below we explicitly `cd' to $srcdir. As for the dependencies,
120 # thanks God for VPATH. Hm...
121 autoconfdir = $(top_srcdir)/lib/autoconf
122 AUTOCONF_FILES = $(autoconfdir)/general.m4 \
123 $(autoconfdir)/status.m4 \
124 $(autoconfdir)/autoheader.m4 \
125 $(autoconfdir)/autoupdate.m4 \
126 $(autoconfdir)/specific.m4 \
127 $(autoconfdir)/functions.m4 \
128 $(autoconfdir)/lang.m4 \
129 $(autoconfdir)/c.m4 \
130 $(autoconfdir)/fortran.m4 \
131 $(autoconfdir)/headers.m4 \
132 $(autoconfdir)/libs.m4 \
133 $(autoconfdir)/types.m4 \
134 $(autoconfdir)/programs.m4
136 $(TESTSUITE_GENERATED_AT): mktests.sh $(AUTOCONF_FILES)
137 cd $(srcdir) && ./mktests.sh $(AUTOCONF_FILES)
140 ## maintainer-check ##
142 maintainer-check: maintainer-check-posix maintainer-check-c++
144 # The hairy heredoc is more robust than using echo.
147 echo '#! $(SHELL)' >expr
148 echo 'result=`@EXPR@ "$$@"`' >>expr
149 echo 'estatus=$$?' >>expr
150 echo 'cat <<EOF' >>expr
151 echo '$${result:-0}' >>expr
153 echo 'exit $$estatus' >>expr
156 # Try the test suite with more severe environments.
157 maintainer-check-posix: expr
158 POSIXLY_CORRECTLY=yes make check
161 # Try using G++ as a C compiler.
162 maintainer-check-c++: