Generate package.m4 in build-dir, not srcdir.

* tests/Makefile.am (package.m4): Adjust target.
Don't redirect directly to $@.
(CLEANFILES): Add package.m4.
($(TESTSUITE)): Depend on just-built package.m4, not the one
in $(srcdir).
When running $(AUTOTEST), search "." before searching $(srcdir).
This commit is contained in:
Jim Meyering 2007-11-10 22:26:01 +01:00
parent 8c6b4481bd
commit d6fb497d07
2 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,13 @@
2007-11-10 Jim Meyering <meyering@redhat.com>
Generate package.m4 in build-dir, not srcdir.
* tests/Makefile.am (package.m4): Adjust target.
Don't redirect directly to $@.
(CLEANFILES): Add package.m4.
($(TESTSUITE)): Depend on just-built package.m4, not the one
in $(srcdir).
When running $(AUTOTEST), search "." before searching $(srcdir).
Avoid a race condition that would make parallel "distclean" fail.
* tests/Makefile.am (distclean-generic): Replace the default,
automake-provided rule with an identical one, but with an additional

View File

@ -35,7 +35,7 @@ include ../lib/freeze.mk
## ------------ ##
# The `:;' works around a redirected compound command bash exit status bug.
$(srcdir)/package.m4: Makefile
package.m4: Makefile
:; \
{ \
echo '# Signature of the current package.'; \
@ -44,7 +44,8 @@ $(srcdir)/package.m4: Makefile
echo 'm4_define([AT_PACKAGE_VERSION], [$(PACKAGE_VERSION)])'; \
echo 'm4_define([AT_PACKAGE_STRING], [$(PACKAGE_STRING)])'; \
echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
} >$(srcdir)/package.m4
} > $@-t
mv $@-t $@
@ -53,7 +54,7 @@ $(srcdir)/package.m4: Makefile
## ---------- ##
wrappers = autoconf autoheader autom4te autoreconf autoscan autoupdate ifnames
CLEANFILES = wrapper.in $(wrappers)
CLEANFILES = wrapper.in $(wrappers) package.m4
wrapper.in: $(srcdir)/wrapper.as $(m4sh_m4f_dependencies)
$(MY_AUTOM4TE) --language=M4sh $(srcdir)/wrapper.as -o $@
@ -109,12 +110,12 @@ TESTSUITE = ./testsuite
# Don't use AUTOM4TE since `make alpha' makes it unavailable although
# we are allowed to use it (since we ship it).
AUTOTEST = $(MY_AUTOM4TE) --language=autotest
$(TESTSUITE): $(srcdir)/package.m4 \
$(TESTSUITE): package.m4 \
local.at \
$(TESTSUITE_AT) \
$(autotest_m4f_dependencies)
cd $(top_builddir)/lib/autotest && $(MAKE) $(AM_MAKEFLAGS) autotest.m4f
$(AUTOTEST) -I $(srcdir) suite.at -o $@.tmp
$(AUTOTEST) -I . -I $(srcdir) suite.at -o $@.tmp
mv $@.tmp $@
atconfig: $(top_builddir)/config.status