summaryrefslogtreecommitdiff
path: root/tools/linktrace-to-depfile.pl
diff options
context:
space:
mode:
Diffstat (limited to 'tools/linktrace-to-depfile.pl')
-rw-r--r--tools/linktrace-to-depfile.pl19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/linktrace-to-depfile.pl b/tools/linktrace-to-depfile.pl
new file mode 100644
index 000000000..9c90af322
--- /dev/null
+++ b/tools/linktrace-to-depfile.pl
@@ -0,0 +1,19 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Cwd qw(abs_path);
+
+my %deps;
+
+while (my $line = <>) {
+ chomp $line;
+ $line =~ s/[()]/ /g;
+ for my $word (split(/\s+/, $line)) {
+ $deps{abs_path($word)} = 1 if ($word =~ /\.a$/);
+ }
+}
+
+my @deps = keys %deps;
+
+print join("\t\\\n\t", @deps), "\n";
+