Bug 285627 mddepend.pl processes Windows depend files inefficiently r=bsmedberg

This commit is contained in:
neil%parkwaycc.co.uk 2005-03-14 15:57:26 +00:00
Родитель e07e75cd23
Коммит 3b158ac968
2 изменённых файлов: 11 добавлений и 11 удалений

Просмотреть файл

@ -51,9 +51,9 @@
$outfile = shift @ARGV;
my $silent = $ENV{MAKEFLAGS} =~ /^\w*s|\s-s/;
@alldeps=();
%alldeps={};
# Parse dependency files
while ($line = <STDIN>) {
while ($line = <>) {
chomp $line;
# Remove extra ^M caused by using dos-mode line-endings
chop $line if (substr($line, -1, 1) eq "\r");
@ -66,9 +66,10 @@ while ($line = <STDIN>) {
} else {
$hasSlash = 0;
}
$deps = [ $obj, split /\s+/, $rest ];
push @{$alldeps{$obj}}, split /\s+/, $rest;
print "add $obj $rest\n" if $debug;
while ($hasSlash and $line = <STDIN>) {
while ($hasSlash and $line = <>) {
chomp $line;
if ($line =~ /\\$/) {
chop $line;
@ -76,15 +77,14 @@ while ($line = <STDIN>) {
$hasSlash = 0;
}
$line =~ s/^\s+//;
push @{$deps}, split /\s+/, $line;
push @{$alldeps{$obj}}, split /\s+/, $line;
print "add $obj $line\n" if $debug;
}
warn "add @{$deps}\n" if $debug;
push @alldeps, $deps;
}
# Test dependencies
foreach $deps (@alldeps) {
$obj = shift @{$deps};
foreach $obj (keys %alldeps) {
$deps = $alldeps{$obj};
$mtime = (stat $obj)[9] or next;
@ -113,7 +113,7 @@ if (@objs) {
# Only write out the dependencies if they are different.
if ($new_output ne $old_output) {
open(OUT, ">$outfile") and binmode(OUT) and print OUT "$new_output";
open(OUT, ">$outfile") and print OUT "$new_output";
print "Updating dependencies file, $outfile\n" unless $silent;
if ($debug) {
print "new: $new_output\n";

Просмотреть файл

@ -1768,7 +1768,7 @@ ifdef PERL
# because it handles the case when header files are removed from the build.
# 'make' would complain that there is no way to build missing headers.
$(MDDEPDIR)/.all.pp: FORCE
@cat $(MDDEPEND_FILES) | $(PERL) $(BUILD_TOOLS)/mddepend.pl $@
$(PERL) $(BUILD_TOOLS)/mddepend.pl $@ $(MDDEPEND_FILES)
-include $(MDDEPDIR)/.all.pp
else
include $(MDDEPEND_FILES)