1 ## Process this file with automake to create Makefile.in. -*-Makefile-*-
3 ## Makefile for Autoconf testsuite.
4 ## Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005
5 ## Free Software Foundation, Inc.
7 ## This program is free software; you can redistribute it and/or modify
8 ## it under the terms of the GNU General Public License as published by
9 ## the Free Software Foundation; either version 2, or (at your option)
12 ## This program is distributed in the hope that it will be useful,
13 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ## GNU General Public License for more details.
17 ## You should have received a copy of the GNU General Public License
18 ## along with this program; if not, write to the Free Software
19 ## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 # We don't actually distribute the testsuite, since one only
23 # needs m4 to build it, m4 being required anyway to install Autoconf.
24 EXTRA_DIST = $(TESTSUITE_AT) local.at mktests.sh \
25 atlocal.in package.m4 wrapper.as
27 # Running the uninstalled scripts.
28 check_SCRIPTS = $(wrappers)
29 DISTCLEANFILES = atconfig atlocal $(TESTSUITE)
30 MAINTAINERCLEANFILES = Makefile.in
32 # Import the dependencies on Autotest and M4sh.
33 include ../lib/freeze.mk
40 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
42 echo '# Signature of the current package.'; \
43 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
44 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
45 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
46 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
47 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
48 } >$(srcdir)/package.m4
56 wrappers = autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
57 CLEANFILES = wrapper.in $(wrappers)
59 wrapper.in: $(srcdir)/wrapper.as $(m4sh_m4f_dependencies)
60 $(MY_AUTOM4TE) --language=M4sh $(srcdir)/wrapper.as -o $@
63 -e 's|@wrap_program[@]|$@|g' \
64 -e 's|@abs_top_srcdir[@]|@abs_top_srcdir@|g' \
65 -e 's|@abs_top_builddir[@]|@abs_top_builddir@|g' \
66 -e 's|@configure_input[@]|Generated from $<.|g'
68 $(wrappers): wrapper.in
70 $(edit) wrapper.in >$@.tmp
81 TESTSUITE_GENERATED_AT = \
82 aclang.at acc.at acfortran.at \
83 acgeneral.at acstatus.at \
84 acautoheader.at acautoupdate.at \
85 acspecific.at acfunctions.at acheaders.at actypes.at \
86 aclibs.at acprograms.at
90 m4sugar.at m4sh.at autotest.at \
91 base.at tools.at torture.at \
92 compile.at c.at fortran.at \
97 TESTSUITE_AT = $(TESTSUITE_GENERATED_AT) $(TESTSUITE_HAND_AT)
98 TESTSUITE = ./testsuite
100 # Run the non installed autom4te.
101 # Don't use AUTOM4TE since `make alpha' makes it unavailable although
102 # we are allowed to use it (since we ship it).
103 AUTOTEST = ./autom4te --language=autotest
104 $(TESTSUITE): $(srcdir)/package.m4 \
107 $(autotest_m4f_dependencies)
108 cd $(top_builddir)/lib/autotest && $(MAKE) $(AM_MAKEFLAGS) autotest.m4f
109 $(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp
112 atconfig: $(top_builddir)/config.status
113 cd $(top_builddir) && ./config.status tests/$@
116 test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
118 rm -f -r autom4te.cache
120 check-local: atconfig atlocal $(TESTSUITE)
121 $(SHELL) $(TESTSUITE) $(TESTSUITEFLAGS)
123 # Run the test suite on the *installed* tree.
124 installcheck-local: atconfig atlocal $(TESTSUITE)
125 $(SHELL) $(TESTSUITE) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
129 ## ------------------ ##
130 ## Maintainer rules. ##
131 ## ------------------ ##
133 MAINTAINERCLEANFILES += $(TESTSUITE_GENERATED_AT)
135 ## Producing the test files.
137 # The files which contains macro we check for syntax. Don't use $(top_srcdir)
138 # here since below we explicitly `cd' to $srcdir. As for the dependencies,
139 # thanks God for VPATH. Hm...
140 autoconfdir = ../lib/autoconf
141 AUTOCONF_FILES = $(autoconfdir)/general.m4 \
142 $(autoconfdir)/status.m4 \
143 $(autoconfdir)/autoheader.m4 \
144 $(autoconfdir)/autoupdate.m4 \
145 $(autoconfdir)/specific.m4 \
146 $(autoconfdir)/functions.m4 \
147 $(autoconfdir)/lang.m4 \
148 $(autoconfdir)/c.m4 \
149 $(autoconfdir)/fortran.m4 \
150 $(autoconfdir)/headers.m4 \
151 $(autoconfdir)/libs.m4 \
152 $(autoconfdir)/types.m4 \
153 $(autoconfdir)/programs.m4
155 $(TESTSUITE_GENERATED_AT): mktests.sh $(AUTOCONF_FILES)
156 cd $(srcdir) && ./mktests.sh $(AUTOCONF_FILES)
159 ## maintainer-check ##
161 maintainer-check: maintainer-check-posix maintainer-check-c++
163 # The hairy heredoc is more robust than using echo.
166 echo '#! $(SHELL)' >expr
167 echo 'result=`@EXPR@ "$$@"`' >>expr
168 echo 'estatus=$$?' >>expr
169 echo 'cat <<EOF' >>expr
170 echo '$${result:-0}' >>expr
172 echo 'exit $$estatus' >>expr
175 # Try the test suite with more severe environments.
176 maintainer-check-posix: expr
177 POSIXLY_CORRECTLY=yes make check
180 # Try using G++ as a C compiler.
181 maintainer-check-c++: