summaryrefslogtreecommitdiff
path: root/mk/help
diff options
context:
space:
mode:
authorrillig <rillig>2007-01-08 02:27:05 +0000
committerrillig <rillig>2007-01-08 02:27:05 +0000
commit4f377a56fa61d70e49ee3af66389370d955ec0e5 (patch)
tree147c7eb1ae4c1ef85e01c5fd51fd15db8a16c358 /mk/help
parent4eb929c9da6d6ceb2d697b2c6e66fe4ed528c5c9 (diff)
downloadpkgsrc-4f377a56fa61d70e49ee3af66389370d955ec0e5.tar.gz
In make targets, it is seldomly useful to show the implementation to the
user.
Diffstat (limited to 'mk/help')
-rw-r--r--mk/help/help.awk13
1 files changed, 10 insertions, 3 deletions
diff --git a/mk/help/help.awk b/mk/help/help.awk
index 51b9e869bf3..02c5c34e264 100644
--- a/mk/help/help.awk
+++ b/mk/help/help.awk
@@ -1,4 +1,4 @@
-# $NetBSD: help.awk,v 1.6 2007/01/07 08:48:11 rillig Exp $
+# $NetBSD: help.awk,v 1.7 2007/01/08 02:27:05 rillig Exp $
#
# This program extracts the inline documentation from *.mk files.
@@ -23,6 +23,7 @@ BEGIN {
relevant = no; # are the current lines relevant?
nlines = 0; # the number of lines collected so far
comment_lines = 0; # the number of comment lines so far
+ print_noncomment_lines = yes; # for make targets, this isn't useful
}
always {
@@ -77,6 +78,11 @@ NF >= 2 {
}
}
+# Don't print the implementation of make targets.
+$1 == uctopic":" {
+ print_noncomment_lines = no;
+}
+
$1 == "#" {
comment_lines++;
}
@@ -90,8 +96,8 @@ $1 == "#" {
found_anything = yes;
print "===> "last_fname":";
for (i = 0; i < nlines; i++) {
- #print gensub(/^# ?/, "", "", lines[i]);
- print lines[i];
+ if (!print_noncomment_lines || (lines[i] ~ /^#/))
+ print lines[i];
}
}
@@ -100,6 +106,7 @@ $1 == "#" {
relevant = no;
nlines = 0;
comment_lines = 0;
+ print_noncomment_lines = yes;
}
always {