From a8be2cf641ffec8d813c73b0e20d3a978c3e191f Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Thu, 24 Aug 2000 11:28:41 +0000 Subject: [PATCH] Speed it up by moving the two sub's into the main loop. Also print out dependencies immediately instead of buffering them. --- build/mkdep.awk | 24 +++++++++++++----------- 1 file 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") } } -- 2.40.0