1 ## Make Autoconf tests.
3 # Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006
4 # 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 3 of the License, or
9 # (at your option) any later version.
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, see <http://www.gnu.org/licenses/>.
19 # We don't actually distribute the testsuite, since one only
20 # needs m4 to build it, m4 being required anyway to install Autoconf.
21 EXTRA_DIST = $(TESTSUITE_AT) local.at mktests.sh \
22 atlocal.in package.m4 wrapper.as
24 # Running the uninstalled scripts.
25 check_SCRIPTS = $(wrappers)
26 DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
27 MAINTAINERCLEANFILES = Makefile.in
29 # Import the dependencies on Autotest and M4sh.
30 include ../lib/freeze.mk
37 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
39 echo '# Signature of the current package.'; \
40 echo 'm4_define([AT_PACKAGE_NAME], [$(PACKAGE_NAME)])'; \
41 echo 'm4_define([AT_PACKAGE_TARNAME], [$(PACKAGE_TARNAME)])'; \
42 echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \
43 echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \
44 echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
45 } >$(srcdir)/package.m4
53 wrappers = autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
54 CLEANFILES = wrapper.in $(wrappers)
56 wrapper.in: $(srcdir)/wrapper.as $(m4sh_m4f_dependencies)
57 $(MY_AUTOM4TE) --language=M4sh $(srcdir)/wrapper.as -o $@
60 -e 's|@wrap_program[@]|$@|g' \
61 -e 's|@abs_top_srcdir[@]|@abs_top_srcdir@|g' \
62 -e 's|@abs_top_builddir[@]|@abs_top_builddir@|g' \
63 -e "s|@configure_input[@]|Generated from $$input.|g"
65 $(wrappers): wrapper.in
68 $(edit) wrapper.in >$@.tmp
79 TESTSUITE_GENERATED_AT = \
82 $(srcdir)/acfortran.at \
83 $(srcdir)/acgeneral.at \
84 $(srcdir)/acstatus.at \
85 $(srcdir)/acautoheader.at \
86 $(srcdir)/acautoupdate.at \
87 $(srcdir)/acspecific.at \
88 $(srcdir)/acfunctions.at \
89 $(srcdir)/acheaders.at \
90 $(srcdir)/actypes.at \
92 $(srcdir)/acprograms.at
96 m4sugar.at m4sh.at autotest.at \
97 base.at tools.at torture.at \
98 compile.at c.at fortran.at \
103 TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT)
104 TESTSUITE = ./testsuite
106 # Run the non installed autom4te.
107 # Don't use AUTOM4TE since `make alpha' makes it unavailable although
108 # we are allowed to use it (since we ship it).
109 AUTOTEST = $(MY_AUTOM4TE) --language=autotest
110 $(TESTSUITE): $(srcdir)/package.m4 \
113 $(autotest_m4f_dependencies)
114 cd $(top_builddir)/lib/autotest && $(MAKE) $(AM_MAKEFLAGS) autotest.m4f
115 $(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp
118 atconfig: $(top_builddir)/config.status
119 cd $(top_builddir) && ./config.status tests/$@
122 test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
124 rm -f -r autom4te.cache
126 check-local: atconfig atlocal $(TESTSUITE)
127 $(SHELL) $(TESTSUITE) $(TESTSUITEFLAGS)
129 # Run the test suite on the *installed* tree.
130 installcheck-local: atconfig atlocal $(TESTSUITE)
131 $(SHELL) $(TESTSUITE) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
135 ## ------------------ ##
136 ## Maintainer rules. ##
137 ## ------------------ ##
139 MAINTAINERCLEANFILES += $(TESTSUITE_GENERATED_AT)
141 ## Producing the test files.
143 # The files which contain macros we check for syntax. Use $(top_srcdir)
144 # for the benefit of non-GNU make. Fix the names in the rule below
145 # where we `cd' to $srcdir.
146 autoconfdir = $(top_srcdir)/lib/autoconf
147 AUTOCONF_FILES = $(autoconfdir)/general.m4 \
148 $(autoconfdir)/status.m4 \
149 $(autoconfdir)/autoheader.m4 \
150 $(autoconfdir)/autoupdate.m4 \
151 $(autoconfdir)/specific.m4 \
152 $(autoconfdir)/functions.m4 \
153 $(autoconfdir)/lang.m4 \
154 $(autoconfdir)/c.m4 \
155 $(autoconfdir)/fortran.m4 \
156 $(autoconfdir)/headers.m4 \
157 $(autoconfdir)/libs.m4 \
158 $(autoconfdir)/types.m4 \
159 $(autoconfdir)/programs.m4
161 $(TESTSUITE_GENERATED_AT): mktests.sh $(AUTOCONF_FILES)
162 cd $(srcdir) && ./mktests.sh \
163 `echo " "$(AUTOCONF_FILES) | sed 's, [^ ]*/, ../lib/autoconf/,g'`
166 ## maintainer-check ##
168 maintainer-check: maintainer-check-posix maintainer-check-c++
170 # The hairy heredoc is more robust than using echo.
173 echo '#! $(SHELL)' >expr
174 echo 'result=`$(EXPR) "$$@"`'>>expr
175 echo 'estatus=$$?' >>expr
176 echo 'cat <<EOF' >>expr
177 echo '$${result:-0}' >>expr
179 echo 'exit $$estatus' >>expr
182 # Try the test suite with more severe environments.
183 maintainer-check-posix: expr
184 POSIXLY_CORRECT=yes make check
187 # Try using G++ as a C compiler.
188 maintainer-check-c++: