]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] clean: simplify cleaning of compiled objects
authorStefano Lattarini <stefano.lattarini@gmail.com>
Wed, 30 May 2012 16:57:18 +0000 (18:57 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 21 Jun 2012 19:08:56 +0000 (21:08 +0200)
* automake.in (handle_compile): Compiled objects are always to be
removed upon "make mostlyclean", never requiring a much stronger
"make distclean" to be cleaned.  Simplify accordingly.
* 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 <stefano.lattarini@gmail.com>
automake.in
lib/am/compile.am

index 6932bf5796e3539944973d9dc46589105e3031d1..66071e50e8b4bae884c91bab144d8e2dcd0cba17 100644 (file)
@@ -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";
 }
index 3be6f7d33bb1f17368fada19b35f4c66bdc946d8..4ef5f3549b3adf596226d2405902358aeeb2dee3 100644 (file)
@@ -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