pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/mk/help In make targets, it is seldomly useful to show...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ae2d3f7786b2
branches:  trunk
changeset: 523439:ae2d3f7786b2
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Mon Jan 08 02:27:05 2007 +0000

description:
In make targets, it is seldomly useful to show the implementation to the
user.

diffstat:

 mk/help/help.awk |  13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diffs (48 lines):

diff -r 6ab3d381e17f -r ae2d3f7786b2 mk/help/help.awk
--- a/mk/help/help.awk  Mon Jan 08 02:26:03 2007 +0000
+++ b/mk/help/help.awk  Mon Jan 08 02:27:05 2007 +0000
@@ -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 @@
        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 @@
        }
 }
 
+# Don't print the implementation of make targets.
+$1 == uctopic":" {
+       print_noncomment_lines = no;
+}
+
 $1 == "#" {
        comment_lines++;
 }
@@ -90,8 +96,8 @@
                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 @@
        relevant = no;
        nlines = 0;
        comment_lines = 0;
+       print_noncomment_lines = yes;
 }
 
 always {



Home | Main Index | Thread Index | Old Index