-# we must hook those which is kind of annoying to do. This should be harmless
-# on previous versions which generate the stubs directly in config.status.
-_dx_autotest_depfiles = am--depfiles
-$(_dx_autotest_depfiles): $(DEPDIR)/testsuite.P
-$(DEPDIR)/testsuite.P:
+# Use this opportunity to generate accurate prerequisites from distributed
+# testsuite dependencies, needed so that make knows to rebuild the testsuite
+# when source files are modified in a distribution tarball, or after a make
+# distclean.
+#
+# With older Automake the stubs are generated directly in config.status.
+# Since this rule is ignored things should still work but the build may
+# miss modifications to the testsuite on the first build from a tarball.
+@dx_depfiles_target@: ./$(DEPDIR)/testsuite.P
+./$(DEPDIR)/testsuite.P: