summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Schumann <sas@php.net>2000-08-24 11:28:41 +0000
committerSascha Schumann <sas@php.net>2000-08-24 11:28:41 +0000
commita8be2cf641ffec8d813c73b0e20d3a978c3e191f (patch)
tree73b320421f25be78d00852059041b23eb8b07e8c
parentba4ddf32b4cf0dd15d8d3baab35dbf79c4ee37cd (diff)
downloadphp-git-a8be2cf641ffec8d813c73b0e20d3a978c3e191f.tar.gz
Speed it up by moving the two sub's into the main loop.
Also print out dependencies immediately instead of buffering them.
-rw-r--r--build/mkdep.awk24
1 files changed, 13 insertions, 11 deletions
diff --git a/build/mkdep.awk b/build/mkdep.awk
index 07f6dab6fa..597556c5ce 100644
--- a/build/mkdep.awk
+++ b/build/mkdep.awk
@@ -26,24 +26,26 @@
target2=target
sub("\.(c|cpp)$", ".lo", target);
sub("\.(c|cpp)$", ".slo", target2);
- deplist=""
for (e in used)
delete used[e]
cmdx=cmd " " filenames[i]
+ done=0
while ((cmdx | getline) > 0) {
- sub(top_srcdir, "$(top_srcdir)", $0)
- sub(top_builddir, "$(top_builddir)", $0)
- if (match($0, "^# [0-9]* \".*\.h\"") != 0 \
- && match($3, "^\"/") == 0 \
- && !($3 in used)) {
- deplist=deplist " \\\n\t" substr($3,2,length($3)-2)
- used[$3] = 1;
+ if (match($0, "^# [0-9]* \".*\.h\"") != 0) {
+ sub(top_srcdir, "$(top_srcdir)", $3)
+ sub(top_builddir, "$(top_builddir)", $3)
+ if (substr($3,2,1) != "/" && used[$3] != 1) {
+ if (done == 0)
+ printf("%s", target " " target2 ":")
+ done=1
+ printf("%s", " \\\n\t" substr($3,2,length($3)-2))
+ used[$3] = 1;
+ }
}
}
-
- if (deplist != "")
- print target " " target2 ":" deplist "\n";
+ if (done == 1)
+ printf("\n\n")
}
}