From 1202aff29bb3fe8428cc32b079c3cc79d8130bfd Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Wed, 30 May 2012 18:57:18 +0200 Subject: [PATCH] [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 --- automake.in | 23 +++-------------------- lib/am/compile.am | 7 +------ 2 files changed, 4 insertions(+), 26 deletions(-) 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 -- 2.47.2