summaryrefslogtreecommitdiff
path: root/mk/help
diff options
context:
space:
mode:
authorrillig <rillig>2008-02-19 22:12:00 +0000
committerrillig <rillig>2008-02-19 22:12:00 +0000
commit98c986a091243ca7ea3b4cd73bb377a47c676f5e (patch)
tree08a81b2b33a2bec089ab09d4a7412ae0e077d2dc /mk/help
parentba49211c038c3f9e400b4f9866c98770d0e8e8ee (diff)
downloadpkgsrc-98c986a091243ca7ea3b4cd73bb377a47c676f5e.tar.gz
Rewrote the help file parser a little bit, so that the definitions from
defaults/mk.conf can be found again. (The words didn't end with [A-Za-z0-9], but rather with "?=".
Diffstat (limited to 'mk/help')
-rw-r--r--mk/help/help.awk22
1 files changed, 15 insertions, 7 deletions
diff --git a/mk/help/help.awk b/mk/help/help.awk
index 612135aaee6..442dd935660 100644
--- a/mk/help/help.awk
+++ b/mk/help/help.awk
@@ -1,4 +1,4 @@
-# $NetBSD: help.awk,v 1.22 2008/02/12 07:16:40 rillig Exp $
+# $NetBSD: help.awk,v 1.23 2008/02/19 22:12:00 rillig Exp $
#
# This program extracts the inline documentation from *.mk files.
@@ -43,7 +43,7 @@ function end_of_topic() {
for (k in keywords)
all_keywords[k]++;
- relevant = (topic in keywords || lctopic in keywords || uctopic in keywords);
+ relevant = (topic in keywords || lctopic in keywords || uctopic in keywords || topic == ":all");
if (relevant && !print_index) {
if (found_anything)
@@ -132,11 +132,19 @@ NF >= 1 && !/^[\t.]/ && !/^#*$/ {
if (w ~ /\+=$/) {
# Appending to a variable is usually not a definition.
- } else if (!(w == toupper(w)) || (w == tolower(w) && w ~ /:$/)) {
- # Automatic keywords must be either upper- or lower-case.
- # Lower-case keywords (make targets) must end with a colon.
+ } else if (w != toupper(w) && w != tolower(w)) {
+ # Words in mixed case are not taken as keywords. If you
+ # want them anyway, list them in a "Keywords:" line.
- } else if (w !~ /^[A-Za-z].*[0-9A-Za-z]:?$/) {
+ } else if (w == tolower(w) && !(w ~ /:$/)) {
+ # Lower-case words (often make targets) must be followed
+ # by a colon to be recognized as keywords.
+
+ } else if (w == toupper(w) && w ~ /:$/) {
+ # Upper-case words ending with a colon are probably not
+ # make targets, so ignore them.
+
+ } else if (w !~ /^[A-Za-z].*[0-9A-Za-z](:|\?=|=)?$/) {
# Keywords must start with a letter and end with a letter
# or digit.
@@ -145,7 +153,7 @@ NF >= 1 && !/^[\t.]/ && !/^#*$/ {
} else {
sub(/^#[ \t]*/, "", w);
- sub(/\??=.*$/, "", w);
+ sub(/(:|\?=|=)$/, "", w);
sub(/:$/, "", w);
if (w != "") {
keywords[w] = yes;