From: Stefano Lattarini Date: Wed, 30 May 2012 16:57:18 +0000 (+0200) Subject: [ng] clean: simplify cleaning of compiled objects X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1202aff29bb3fe8428cc32b079c3cc79d8130bfd;p=thirdparty%2Fautomake.git [ng] clean: simplify cleaning of compiled objects * 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 --- diff --git a/automake.in b/automake.in index 6932bf579..66071e50e 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 3be6f7d33..4ef5f3549 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