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 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., 51 Franklin Street, Fifth Floor, 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 = $(wrappers)
28 DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
29 MAINTAINERCLEANFILES = Makefile.in
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 wrappers = autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
56 CLEANFILES = wrapper.in $(wrappers)
58 wrapper.in: $(srcdir)/wrapper.as $(m4sh_m4f_dependencies)
59 $(MY_AUTOM4TE) --language=M4sh $(srcdir)/wrapper.as -o $@
62 -e 's|@wrap_program[@]|$@|g' \
63 -e 's|@abs_top_srcdir[@]|@abs_top_srcdir@|g' \
64 -e 's|@abs_top_builddir[@]|@abs_top_builddir@|g' \
65 -e "s|@configure_input[@]|Generated from $$input.|g"
67 $(wrappers): wrapper.in
70 $(edit) wrapper.in >$@.tmp
81 TESTSUITE_GENERATED_AT = \
84 $(srcdir)/acfortran.at \
85 $(srcdir)/acgeneral.at \
86 $(srcdir)/acstatus.at \
87 $(srcdir)/acautoheader.at \
88 $(srcdir)/acautoupdate.at \
89 $(srcdir)/acspecific.at \
90 $(srcdir)/acfunctions.at \
91 $(srcdir)/acheaders.at \
92 $(srcdir)/actypes.at \
94 $(srcdir)/acprograms.at
98 m4sugar.at m4sh.at autotest.at \
99 base.at tools.at torture.at \
100 compile.at c.at fortran.at \
105 TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT)
106 TESTSUITE = ./testsuite
108 # Run the non installed autom4te.
109 # Don't use AUTOM4TE since `make alpha' makes it unavailable although
110 # we are allowed to use it (since we ship it).
111 AUTOTEST = $(MY_AUTOM4TE) --language=autotest
112 $(TESTSUITE): $(srcdir)/package.m4 \
115 $(autotest_m4f_dependencies)
116 cd $(top_builddir)/lib/autotest && $(MAKE) $(AM_MAKEFLAGS) autotest.m4f
117 $(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp
120 atconfig: $(top_builddir)/config.status
121 cd $(top_builddir) && ./config.status tests/$@
124 test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
126 rm -f -r autom4te.cache
128 check-local: atconfig atlocal $(TESTSUITE)
129 $(SHELL) $(TESTSUITE) $(TESTSUITEFLAGS)
131 # Run the test suite on the *installed* tree.
132 installcheck-local: atconfig atlocal $(TESTSUITE)
133 $(SHELL) $(TESTSUITE) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
137 ## ------------------ ##
138 ## Maintainer rules. ##
139 ## ------------------ ##
141 MAINTAINERCLEANFILES += $(TESTSUITE_GENERATED_AT)
143 ## Producing the test files.
145 # The files which contain macros we check for syntax. Use $(top_srcdir)
146 # for the benefit of non-GNU make. Fix the names in the rule below
147 # where we `cd' to $srcdir.
148 autoconfdir = $(top_srcdir)/lib/autoconf
149 AUTOCONF_FILES = $(autoconfdir)/general.m4 \
150 $(autoconfdir)/status.m4 \
151 $(autoconfdir)/autoheader.m4 \
152 $(autoconfdir)/autoupdate.m4 \
153 $(autoconfdir)/specific.m4 \
154 $(autoconfdir)/functions.m4 \
155 $(autoconfdir)/lang.m4 \
156 $(autoconfdir)/c.m4 \
157 $(autoconfdir)/fortran.m4 \
158 $(autoconfdir)/headers.m4 \
159 $(autoconfdir)/libs.m4 \
160 $(autoconfdir)/types.m4 \
161 $(autoconfdir)/programs.m4
163 $(TESTSUITE_GENERATED_AT): mktests.sh $(AUTOCONF_FILES)
164 cd $(srcdir) && ./mktests.sh \
165 `echo " "$(AUTOCONF_FILES) | sed 's, [^ ]*/, ../lib/autoconf/,g'`
168 ## maintainer-check ##
170 maintainer-check: maintainer-check-posix maintainer-check-c++
172 # The hairy heredoc is more robust than using echo.
175 echo '#! $(SHELL)' >expr
176 echo 'result=`$(EXPR) "$$@"`'>>expr
177 echo 'estatus=$$?' >>expr
178 echo 'cat <<EOF' >>expr
179 echo '$${result:-0}' >>expr
181 echo 'exit $$estatus' >>expr
184 # Try the test suite with more severe environments.
185 maintainer-check-posix: expr
186 POSIXLY_CORRECT=yes make check
189 # Try using G++ as a C compiler.
190 maintainer-check-c++: