]> git.draconx.ca Git - dxcommon.git/blobdiff - snippet/autotest.mk
Fix autotest snippet with --disable-dependency-tracking.
[dxcommon.git] / snippet / autotest.mk
index badfc9f97ce0c11d71c4d83f8a1989fb0a52e596..5b3764bbaa82b2624c276c6293669e6a6c8cea5d 100644 (file)
@@ -1,8 +1,12 @@
-# Copyright © 2015,2019-2020 Nick Bowler
+# Copyright © 2015,2019-2022 Nick Bowler
 #
-# Automake fragment to hook up a basic Autotest test suite into the build.
-# It is expected that a testsuite.at file exists in $(srcdir).  The
-# testsuite will be output to $(builddir)/testsuite.
+# Automake fragment to hook up a basic Autotest test suite into the
+# build.  It is expected that a testsuite.at file exists in $(srcdir).
+# The testsuite will be output to $(builddir)/testsuite.
+#
+# The DX_AUTOMAKE_COMPAT macro must be expanded by configure.ac to
+# provide necessary substitutions.  If DX_PROG_AUTOTEST is used, this
+# will be included automatically.
 #
 # You must define the AUTOTEST variable to the Autotest program (normally,
 # this is autom4te -l autotest).  The DX_PROG_AUTOTEST macro can be used
@@ -62,8 +66,10 @@ endif
        $(AM_V_GEN) $(DX_AUTOTEST) -p m4_include -o $@.tmp testsuite.at
        $(AM_V_at) $(DX_AUTOTEST) -t m4_include:'$$1' -o $@.deps.tmp \
          testsuite.at
+if AMDEP
        $(AM_V_at) exec 3<$@.deps.tmp 4>$(DEPDIR)/$(@F).P; \
          while read f <&3; do printf '$@: %s\n%s:\n' "$$f" "$$f" >&4; done
+endif
        $(AM_V_at) mv -f $@.deps.tmp $@.deps
        $(AM_V_at) mv -f $@.tmp $@
 testsuite.deps: testsuite
@@ -81,7 +87,7 @@ dist-autotest-deps: testsuite.deps
 EXTRA_DIST += testsuite testsuite.at testsuite.deps package.m4
 DISTCLEANFILES += atconfig $(DEPDIR)/testsuite.P
 
-@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/testsuite.P@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/testsuite.P@am__quote@@dx_include_marker@
 
 # Automake 1.16 and newer use make rules to generate the dependency stubs.
 # Use this opportunity to generate accurate prerequisites from distributed
@@ -92,9 +98,8 @@ DISTCLEANFILES += atconfig $(DEPDIR)/testsuite.P
 # 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_autotest_depfiles = am--depfiles
-$(_dx_autotest_depfiles): $(DEPDIR)/testsuite.P
-$(DEPDIR)/testsuite.P:
+@dx_depfiles_target@: ./$(DEPDIR)/testsuite.P
+./$(DEPDIR)/testsuite.P:
        @$(MKDIR_P) $(@D)
        @if test -f $(builddir)/testsuite.deps; then \
          exec 3<$(builddir)/testsuite.deps; \