summaryrefslogtreecommitdiff
path: root/lib/am/depend.am
diff options
context:
space:
mode:
authorStefano Lattarini <stefano.lattarini@gmail.com>2015-01-03 01:33:45 +0100
committerStefano Lattarini <stefano.lattarini@gmail.com>2015-01-04 18:31:50 +0100
commit0b371a43bf49516fef214b2d2a299c9f5edbb39f (patch)
tree5dade0a11951ea4f148326e561d030fcd9539dc6 /lib/am/depend.am
parent860d21b8854eb61dd79f37f1be564af7efa916c6 (diff)
downloadautomake-experimental/deps-pr13928.tar.gz
deps: fix corner-case "make distclean" bugexperimental/deps-pr13928
Assume we have package satisfying the following conditions: (1) automatic dependency tracking is enabled; (2) the 'subdir-objects' Automake option is enabled; (3) the package uses a recursive make setup. Also assume that: (a) a subdir Makefile declares a foo_SOURCES variable containing a source file in the parent directory; (b) that parent Makefile declare a compiled program itself. Then BSD and Solaris make used to fail when running "make distclean", because the 'distclean' target of the subdir Makefile removed the whole '.deps' directory before the parent Makefile was done with the included '.Po' makefile fragments in that directory. This issue was revealed by failures in the 'subobj-vpath-pr13928.sh' test when those make implementations were used. We fix the issue by ensuring the 'distclean' target of any Makefile only removed the '.Po' makefile fragments included by it, rather than the whole '.deps' directory where such files resides. This change should be the last step in fixing automake bug#13928 for good. * bin/automake.in (handle_languages), lib/am/depend.am: Adjust to implement the new 'distclean' logic. * t/pr224.sh: Adjust to avoid a spurious failure. * PLANS/subdir-objects.txt: Update. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 'lib/am/depend.am')
-rw-r--r--lib/am/depend.am7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/am/depend.am b/lib/am/depend.am
index 0b226b6ba..3813996ec 100644
--- a/lib/am/depend.am
+++ b/lib/am/depend.am
@@ -27,8 +27,9 @@ am--depfiles: $(am__depfiles_remade)
## erase them in -am or -recursive rules; that would prevent any other
## rules from being recursive (for instance multilib clean rules are
## recursive).
+if %?DISTRMS%
distclean:
- -rm -rf %DEPDIRS%
-
+ %DISTRMS%
maintainer-clean:
- -rm -rf %DEPDIRS%
+ %DISTRMS%
+endif