automake-ng
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-NG] [PATCH 03/14] [ng] clean: simplify cleaning of compiled ob


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 03/14] [ng] clean: simplify cleaning of compiled objects
Date: Thu, 21 Jun 2012 12:32:34 +0200

* automake.in (handle_compile): Compiled objects are always to be
removed upon "make mostlyclean", and not (not even sometimes) upon
"make distclean".  Simplify accordingly, removing the checks for a
condition that was never true.
* am/compile.am: Simplify accordingly, and do not bother cleaning
'*.tab.c' files, that shouldn't be left behind by Automake-generated
Makefiles anyway.

Signed-off-by: Stefano Lattarini <address@hidden>
---
 automake.in       |   23 +++--------------------
 lib/am/compile.am |    7 +------
 2 files changed, 4 insertions(+), 26 deletions(-)

diff --git a/automake.in b/automake.in
index 6932bf5..66071e5 100644
--- a/automake.in
+++ b/automake.in
@@ -2237,29 +2237,12 @@ sub handle_compile ()
 {
    return if ! $must_handle_compiled_objects;
 
-    my (@mostly_rms, @dist_rms);
-    foreach my $item (sort keys %compile_clean_files)
-    {
-       if ($compile_clean_files{$item} == MOSTLY_CLEAN)
-       {
-           push (@mostly_rms, "\t-rm -f $item");
-       }
-       elsif ($compile_clean_files{$item} == DIST_CLEAN)
-       {
-           push (@dist_rms, "\t-rm -f $item");
-       }
-       else
-       {
-         prog_error 'invalid entry in %compile_clean_files';
-       }
-    }
-
+    my @mostly_rms = map { "\t-rm -f $_" } sort keys %compile_clean_files;
     my ($coms, $vars, $rules) =
       &file_contents_internal (1, "$libdir/am/compile.am",
                               new Automake::Location,
-                              ('STDINC' => ! option 'nostdinc',
-                               'MOSTLYRMS' => join ("\n", @mostly_rms),
-                               'DISTRMS' => join ("\n", @dist_rms)));
+                              'STDINC' => ! option 'nostdinc',
+                              'MOSTLYRMS' => join ("\n", @mostly_rms));
     $output_vars .= $vars;
     $output_rules .= "$coms$rules";
 }
diff --git a/lib/am/compile.am b/lib/am/compile.am
index 3be6f7d..4ef5f35 100644
--- a/lib/am/compile.am
+++ b/lib/am/compile.am
@@ -32,9 +32,4 @@ mostlyclean-compile:
        -rm -f *.$(OBJEXT)
 ?MOSTLYRMS?%MOSTLYRMS%
 
-distclean-am: distclean-compile
-distclean-compile:
-       -rm -f *.tab.c
-?DISTRMS?%DISTRMS%
-
-.PHONY: mostlyclean-compile distclean-compile
+.PHONY: mostlyclean-compile
-- 
1.7.9.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]