Files
pcas/src/tools/makeDbDepends.pl
Andrew Johnson c32997ffa1 tools: Fix dependency file problem.
Reported by Eric.
2011-12-20 16:30:41 -06:00

25 lines
620 B
Perl

eval 'exec perl -S $0 ${1+"$@"}' # -*- Mode: perl -*-
if $running_under_some_shell; # makeDbDepends.pl
# Called from within RULES.Db in the Db directories.
# Searches .substitutions and .template files (from the command line) for
# file ["']xxx["'] {
# and
# include "xxx"
# entries to include in the DEPENDS file
use strict;
my $target = shift @ARGV;
my %depends;
while (my $line = <>) {
$depends{$2}++ if $line =~ m/^ \s* file \s* (["']?) (\S*) \1 /x;
$depends{$1}++ if $line =~ m/^ \s* include \s* "(.*)" /x;
}
if (%depends) {
my @depends = keys %depends;
print "$target: @depends\n";
}