diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2015-01-03 01:33:45 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2015-01-06 11:26:16 +0100 |
commit | 08849db866b44510f6b8fd49e313c91a43a3dfd3 (patch) | |
tree | 53fc969d2a1ac38e6c738992caa54f88b8c080e6 /bin/automake.in | |
parent | 1b4c84b80d6099fd6747b129630bbf00c388e0f9 (diff) | |
download | automake-08849db866b44510f6b8fd49e313c91a43a3dfd3.tar.gz |
deps: fix corner-case "make distclean" bug
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 'bin/automake.in')
-rw-r--r-- | bin/automake.in | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/bin/automake.in b/bin/automake.in index dd828da62..355d7ff30 100644 --- a/bin/automake.in +++ b/bin/automake.in @@ -1242,14 +1242,16 @@ sub handle_languages () INTERNAL); define_variable ('am__maybe_remake_depfiles', 'depfiles', INTERNAL); define_variable ('am__depfiles_remade', "@dep_files", INTERNAL); - # Generate each 'include' directive individually. Several make - # implementations (IRIX 6, Solaris 10, FreeBSD 8) will fail to - # properly include several files resulting from a variable - # expansion. Just Generating many separate includes seems thus - # safest. $output_rules .= "\n"; + my @dist_rms; foreach my $depfile (@dep_files) { + push @dist_rms, "\t-rm -f $depfile"; + # Generate each 'include' directive individually. Several + # make implementations (IRIX 6, Solaris 10, FreeBSD 8) will + # fail to properly include several files resulting from a + # variable expansion. Just Generating many separate includes + # seems thus safest. $output_rules .= subst ('AMDEP_TRUE') . subst ('am__include') . " " . @@ -1262,11 +1264,9 @@ sub handle_languages () require_conf_file ("$am_file.am", FOREIGN, 'depcomp'); - # Compute the set of directories to remove in distclean-depend. - my @dep_dirs = uniq (map { dirname ($_) } @dep_files); - $output_rules .= file_contents ('depend', - new Automake::Location, - DEPDIRS => "@dep_dirs"); + $output_rules .= file_contents ( + 'depend', new Automake::Location, + 'DISTRMS' => join ("\n", @dist_rms)); } } else |