summaryrefslogtreecommitdiff
path: root/scandeps
diff options
context:
space:
mode:
Diffstat (limited to 'scandeps')
-rwxr-xr-xscandeps9
1 files changed, 3 insertions, 6 deletions
diff --git a/scandeps b/scandeps
index e60c5b8f1..3a5b64092 100755
--- a/scandeps
+++ b/scandeps
@@ -2,10 +2,7 @@
%include = ();
-die "Usage: scandeps prefix object_dirs -- sources" if (@ARGV < 4);
-
-$prefix = shift @ARGV;
-$prefix = $prefix; # silence warning
+die "Usage: scandeps object_dirs -- sources" if (@ARGV < 3);
@objdirs = ();
while (($z = shift @ARGV) ne "--") {
@@ -16,8 +13,8 @@ while (($z = shift @ARGV) ne "--") {
foreach my $file (@ARGV) {
open FILE, "<$file" or die "Failed to open $file: $!";
while (my $line = <FILE>) {
- if ($line =~ m|#include "$prefix/?([^"]+)"|) {
- $include{$file}{$1} = 1;
+ if ($line =~ m|#include "([^"]+)"|) {
+ $include{$file}{$1} = 1 if (-e $1);
}
}
close FILE;