From 9db0ec288993117e2b9a5ad0fb32d57d485fe2ac Mon Sep 17 00:00:00 2001 From: Ralf Corsepius Date: Thu, 12 Jan 2006 04:02:51 +0000 Subject: 2006-10-12 Ralf Corsepius * ampolish3.in: Check if Makefile.am already contains CLEANFILES or DISTCLEANFILES. --- tools/build/ChangeLog | 7 ++++++- tools/build/ampolish3.in | 22 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/tools/build/ChangeLog b/tools/build/ChangeLog index 28f0a801b4..17fdd01f57 100644 --- a/tools/build/ChangeLog +++ b/tools/build/ChangeLog @@ -1,6 +1,11 @@ +2006-10-12 Ralf Corsepius + + * ampolish3.in: Check if Makefile.am already contains CLEANFILES or + DISTCLEANFILES. + 2006-10-10 Ralf Corsepius - * ampolish3.im: Update. + * ampolish3.in: Update. 2005-10-25 Ralf Corsepius diff --git a/tools/build/ampolish3.in b/tools/build/ampolish3.in index b2b19628f6..162a96a364 100755 --- a/tools/build/ampolish3.in +++ b/tools/build/ampolish3.in @@ -1,5 +1,7 @@ #! @PERL@ -w +# $Id$ + # Helper script to generate pre/tmpinstall rules for cpukit Makefile.am. # # Usage: ampolish3 Makefile.am > preinstall.am @@ -102,6 +104,12 @@ foreach my $l ( @buffer1 ) { { # conditionals push @buffer2, "$l"; } + + # Check if Makefile.am already contains CLEANFILES or DISTCLEANFILES + if ( $l =~ /^\s*(CLEANFILES|DISTCLEANFILES)\s*\=.*$/o ) + { + $predefs{"$1"} = 1; + } } if ( $predefs{"\$(PROJECT_INCLUDE)"} ){ @@ -214,9 +222,19 @@ foreach my $k ( keys %seen ) { $output .= "$k =\n"; if ( $k =~ /.*FILES/o ) { - $output .= "CLEANFILES += \$($k)\n"; + $output .= "CLEANFILES "; + if ( $predefs{"CLEANFILES"} ) { + $output .= "+"; + $predefs{"CLEANFILES"} = 1; + } + $output .= "= \$($k)\n"; } elsif ( $k =~ /.*DIRS/o ) { - $output .= "DISTCLEANFILES += \$($k)\n"; + $output .= "DISTCLEANFILES "; + if ( $predefs{"DISTCLEANFILES"} ) { + $output .= "+"; + $predefs{"DISTCLEANFILES"} = 1; + } + $output .= "= \$($k)\n"; } $output .= "\n"; } -- cgit v1.2.3