summaryrefslogtreecommitdiffstats
path: root/tools/build/ampolish3.in
diff options
context:
space:
mode:
Diffstat (limited to 'tools/build/ampolish3.in')
-rwxr-xr-xtools/build/ampolish3.in22
1 files changed, 20 insertions, 2 deletions
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";
}