[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-NG] [RFC] [ng] cleanup: merge '%compile_clean_files' in '%clea
From: |
Stefano Lattarini |
Subject: |
[Automake-NG] [RFC] [ng] cleanup: merge '%compile_clean_files' in '%clean_files' |
Date: |
Thu, 21 Jun 2012 22:19:25 +0200 |
No need to keep them separated anymore.
* automake.in (%libtool_clean_directories): Delete.
(initialize_per_input): Don't reset it.
(handle_compile): Don't merge '%libtool_clean_directories' (after
proper editing) into '%clean_dirs'.
(handle_ltlibraries, handle_programs, handle_single_transform):
Update '%clean_dirs', rather than '%libtool_clean_directories'.
Signed-off-by: Stefano Lattarini <address@hidden>
---
I've written this patch only because I said in a previous reply that
I would have done so, but I really think it should be dropped, because
it makes the code more brittle and harder to understand. WDYT?
Regards,
Stefano
automake.in | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/automake.in b/automake.in
index e438de1..074abf6 100644
--- a/automake.in
+++ b/automake.in
@@ -530,11 +530,6 @@ my @check_tests;
# DIST_CLEAN, etc).
my (%clean_files, %clean_dirs);
-# Keys in this hash table are directories where we expect to build a
-# libtool object. We use this information to decide what directories
-# to delete.
-my %libtool_clean_directories;
-
# Value of $(SOURCES), used by tags.am.
my @sources;
# Sources which go in the distribution.
@@ -652,9 +647,6 @@ sub initialize_per_input ()
%clean_files = ();
%clean_dirs = ();
- # We always include '.'. This isn't strictly correct.
- %libtool_clean_directories = ('.' => 1);
-
@sources = ();
@dist_sources = ();
@@ -1855,8 +1847,7 @@ sub handle_single_transform ($$$$$%)
# If we have a libtool object, then we also must remove
# any '.lo' objects in the same subdirectory.
$clean_files{"$directory/*.lo"} = MOSTLY_CLEAN;
- # Remember to cleanup .libs/ in this directory.
- $libtool_clean_directories{$directory} = 1;
+ $clean_dirs{"$directory/.libs"} = CLEAN;
}
}
@@ -2233,11 +2224,6 @@ sub handle_libtool
check_user_variables 'LIBTOOLFLAGS';
- foreach my $dir (%libtool_clean_directories)
- {
- $clean_dirs{"$dir/.libs"} = CLEAN;
- }
-
if ($relative_dir eq '.')
{
$clean_files{"libtool"} = DIST_CLEAN;
@@ -2305,7 +2291,7 @@ sub handle_programs
my($xlink, $vlink) = &define_per_target_linker_variable ($linker,
$xname);
$vlink = verbose_flag ($vlink || 'GEN');
- $libtool_clean_directories{dirname ($one_file)} = 1;
+ $clean_dirs{dirname ($one_file) . '/.libs'} = CLEAN;
$output_rules .= &file_contents ('program',
$where,
@@ -2643,9 +2629,7 @@ sub handle_ltlibraries
}
}
- # Remember to cleanup .libs/ in this directory.
- my $dirname = dirname $onelib;
- $libtool_clean_directories{$dirname} = 1;
+ $clean_dirs{dirname ($onelib) . '/.libs'} = CLEAN;
$output_rules .= &file_contents ('ltlibrary',
$where,
--
1.7.9.5