The autogenerated makefile fragment 't/testsuite-part.am' used to depend
on the list of *all* the hand-written files. This was technically correct,
since that makefile fragment was (and still is) generated by the script
'gen-testsuite-part', which scans all the hand-written files to detect
implicit dependencies and to decide for which tests a further wrapper test
should be generated.
However, the presence of such a dependency implied that, whenever *any*
test case was modified (no matter how slightly), the 't/testsuite-part.am'
file was rebuilt, and since that is included by our 'Makefile.am', the
'Makefile.in' file was rebuilt as well by automake. In order to do so,
automake scanned our 'configure.ac' file, which requires the latest
Autoconf version (2.69 at the time of writing), and the casual user can
easily lack that on his machine (and that should be allowed, as automake
currently supports any autoconf version >= 2.62).
The described situation could hinder in-field testing or debugging by
users (even experienced ones) that are not automake developers; see for
example automake bug#11347.
So we drop the explicit dependency of 't/testsuite-part.am' on the
hand-written test cases. (As an aside, note that this has already
been done in Automake-NG, albeit for other reasons; see the commit
'v1.11b-129-g1690aca' of 2012-04-23, "[ng] build: define $(TESTS)
through a wildcard").
This is not a serious regression in the faithfulness of the Automake
build systems, since it unfortunately already had several undeclared
dependencies; e.g., 'Makefile.in' should depend on the automake script,
and 'aclocal.m4' should depend on the aclocal script (but this isn't
possible, as it would mean that distributed files depend on ones generated
at make time). Similarly, 'Makefile.in' should depend on some of the
'lib/am/*.am' files, but does not.
Currently, the workaround to get a faithful and correct rebuild is to run
./bootstrap && ./config.status --recheck && make clean all
and the present commit does not change that.
* Makefile.am ($(srcdir)/t/testsuite-part.am): Don't depend on
't/list-of-tests.mk' nor on '$(handwritten_TESTS)' anymore.
($(generated_TESTS)): Likewise, and don't depend on 'Makefile.am'
either.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
$(AM_V_at)mv -f t/testsuite-part.tmp $@
EXTRA_DIST += gen-testsuite-part
-$(generated_TESTS) $(srcdir)/t/testsuite-part.am: \
- $(srcdir)/gen-testsuite-part \
- t/list-of-tests.mk \
- Makefile.am \
- $(handwritten_TESTS)
+## The dependecies declared here are not truly complete, but such
+## completeness would cause more issues than it would solve. See
+## automake bug#11347.
+$(generated_TESTS): $(srcdir)/gen-testsuite-part
+$(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am
# Static dependencies valid for each test case.
check_SCRIPTS = t/wrap/aclocal-$(APIVERSION) t/wrap/automake-$(APIVERSION)