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
## ------------ ##
# The `:;' works around a redirected compound command bash exit status bug.
-$(srcdir)/package.m4: Makefile
+package.m4: Makefile
:; \
{ \
echo '# Signature of the current package.'; \
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 $@
## ---------- ##
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 $@
# 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