netsurf/tools/linktrace-to-depfile.pl
Daniel Silverstone 952d2a524c
linktrace-to-depfile: Support alternative linker trace formatting (for openbsd)
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2020-10-02 20:54:30 +01:00

20 lines
295 B
Perl

#!/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";