diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/util/clean-depend.pl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/lib/libcrypto/util/clean-depend.pl b/src/lib/libcrypto/util/clean-depend.pl new file mode 100644 index 0000000000..af676af751 --- /dev/null +++ b/src/lib/libcrypto/util/clean-depend.pl | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | #!/usr/local/bin/perl -w | ||
| 2 | # Clean the dependency list in a makefile of standard includes... | ||
| 3 | # Written by Ben Laurie <ben@algroup.co.uk> 19 Jan 1999 | ||
| 4 | |||
| 5 | use strict; | ||
| 6 | |||
| 7 | while(<STDIN>) { | ||
| 8 | print; | ||
| 9 | last if /^# DO NOT DELETE THIS LINE/; | ||
| 10 | } | ||
| 11 | |||
| 12 | my %files; | ||
| 13 | |||
| 14 | while(<STDIN>) { | ||
| 15 | my ($file,$deps)=/^(.*): (.*)$/; | ||
| 16 | next if !defined $deps; | ||
| 17 | my @deps=split ' ',$deps; | ||
| 18 | @deps=grep(!/^\/usr\/include/,@deps); | ||
| 19 | @deps=grep(!/^\/usr\/lib\/gcc-lib/,@deps); | ||
| 20 | push @{$files{$file}},@deps; | ||
| 21 | } | ||
| 22 | |||
| 23 | my $file; | ||
| 24 | foreach $file (sort keys %files) { | ||
| 25 | my $len=0; | ||
| 26 | my $dep; | ||
| 27 | foreach $dep (sort @{$files{$file}}) { | ||
| 28 | $len=0 if $len+length($dep)+1 >= 80; | ||
| 29 | if($len == 0) { | ||
| 30 | print "\n$file:"; | ||
| 31 | $len=length($file)+1; | ||
| 32 | } | ||
| 33 | print " $dep"; | ||
| 34 | $len+=length($dep)+1; | ||
| 35 | } | ||
| 36 | } | ||
| 37 | |||
| 38 | print "\n"; | ||
