summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsolenv/bin/concat-deps.pl68
1 files changed, 41 insertions, 27 deletions
diff --git a/solenv/bin/concat-deps.pl b/solenv/bin/concat-deps.pl
index 935a50c68daa..e360dbc280cb 100755
--- a/solenv/bin/concat-deps.pl
+++ b/solenv/bin/concat-deps.pl
@@ -24,21 +24,9 @@ my @depfiles = read_depfiles (shift @ARGV);
my %rules;
print "# concatenated, reduced dependencies generated by solenv/bin/concat-deps.pl\n";
print "# generated with \$(SRCDIR) = $ENV{SRCDIR}\n";
+print "# generated with \$(OUTDIR) = $ENV{OUTDIR}\n";
-sub canonicalize_path($)
-{
- my $line = shift;
- $line =~ /^(\s*)([^\s\n:]*)(.*\n?)$/;
- my $pre = $1;
- my $path = $2;
- my $post =$3;
- if (length($path) > 0 && index($path,$ENV{SRCDIR}) == 0) {
- $path = File::Spec->rel2abs($2);
- $path = "\$(SRCDIR)" . substr($path, length($ENV{SRCDIR}));
- }
- #print "## $pre$path$post";
- return "$pre$path$post";
-}
+my $boost_path = $ENV{OUTDIR} . '/inc/boost/';
for my $fname (@depfiles) {
my $fileh;
@@ -47,20 +35,46 @@ for my $fname (@depfiles) {
open ($fileh, $fname) || die "Can't open $fname: $!\n";
my $last = '';
+ my $rule_count = 0;
+ my $with_boost_count = 0;
while (<$fileh>) {
- my $line = canonicalize_path($_);
-# print "# $line";
- if ($line eq "\n") {
- if ($last =~ /^(.*):\s*$/) {
- if (defined $rules{$1}) {
- $last = '';
- next;
- }
- $rules{$1} = 1;
- }
- }
- print $last;
- $last = $line;
+ # canonicalise path
+ m/^(\s*)([^\s\n:]*)(.*\n?)$/;
+ my $pre = $1;
+ my $path = $2;
+ my $post = $3;
+ $rule_count++ if ($post =~ m/:/);
+ if (length($path) > 0 && index($path,$ENV{SRCDIR}) == 0) {
+ $path = File::Spec->rel2abs($2);
+ if (index($path,$ENV{OUTDIR}) == 0) {
+ my $solverpath = substr($path, length($ENV{OUTDIR}));
+ if ($solverpath =~ m|/inc/boost/|) {
+ if ($with_boost_count != $rule_count || !($post =~ m/\\/)) {
+ $path = '$(OUTDIR)/inc/boost/deliver.log';
+ $with_boost_count = $rule_count;
+ } else { # elide it
+ $path = ''; $pre = ''; $post = '';
+ }
+ } else {
+ $path = "\$(OUTDIR)" . $solverpath;
+ }
+ } else {
+ $path = "\$(SRCDIR)" . substr($path, length($ENV{SRCDIR}));
+ }
+ }
+ $line = "$pre$path$post";
+
+ if ($line eq "\n") {
+ if ($last =~ /^(.*):\s*$/) {
+ if (defined $rules{$1}) {
+ $last = '';
+ next;
+ }
+ $rules{$1} = 1;
+ }
+ }
+ print $last;
+ $last = $line;
}
print "$last\n"; # in case of missing newline