Module Name:    src
Committed By:   rillig
Date:           Sun Sep  5 13:46:31 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: Makefile makeman

Log Message:
lint: generate date of lint.7 from err.c


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/lint1/Makefile
cvs rdiff -u -r1.4 -r1.5 src/usr.bin/xlint/lint1/makeman

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/xlint/lint1/Makefile
diff -u src/usr.bin/xlint/lint1/Makefile:1.84 src/usr.bin/xlint/lint1/Makefile:1.85
--- src/usr.bin/xlint/lint1/Makefile:1.84	Sun Aug 22 22:24:12 2021
+++ src/usr.bin/xlint/lint1/Makefile	Sun Sep  5 13:46:31 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.84 2021/08/22 22:24:12 rillig Exp $
+#	$NetBSD: Makefile,v 1.85 2021/09/05 13:46:31 rillig Exp $
 
 .include <bsd.own.mk>
 
@@ -29,16 +29,34 @@ COPTS.err.c+=	${${ACTIVE_CC} == "clang":
 
 BINDIR=		/usr/libexec
 
-CLEANFILES+=	${MAN}
+CLEANFILES+=	${MAN} ${MAN}.date
 
 .if ${USETOOLS} == "yes"
 LINT1=		${TOOLDIR}/libexec/${MACHINE_GNU_PLATFORM}-lint1
 .endif
 LINT1?=		./${PROG}
 
-${MAN}:		makeman ${LINT1:C/^\.\///} Makefile
+${MAN}.date:	err.c
+	sed -E \
+	    -e 's,.*(....)/([0-9]{2})/0?([0-9]+).*,\2 \3\, \1,' \
+	    -e 's,^01,January,' \
+	    -e 's,^02,February,' \
+	    -e 's,^03,March,' \
+	    -e 's,^04,April,' \
+	    -e 's,^05,May,' \
+	    -e 's,^06,June,' \
+	    -e 's,^07,July,' \
+	    -e 's,^08,August,' \
+	    -e 's,^09,September,' \
+	    -e 's,^10,October,' \
+	    -e 's,^11,November,' \
+	    -e 's,^12,December,' \
+	    -e 1q \
+	    ${.ALLSRC} > ${.TARGET}
+
+${MAN}:		makeman ${LINT1:./%=%} Makefile ${MAN}.date
 	${_MKTARGET_CREATE}
-	${HOST_SH} ${.ALLSRC:M*makeman} ${LINT1} -m >${.TARGET}
+	${HOST_SH} ${.ALLSRC:M*makeman} "$$(cat ${.ALLSRC:M*.date})" ${LINT1} -m >${.TARGET}
 
 LDADD+=		-lm
 .ifndef HOSTPROG

Index: src/usr.bin/xlint/lint1/makeman
diff -u src/usr.bin/xlint/lint1/makeman:1.4 src/usr.bin/xlint/lint1/makeman:1.5
--- src/usr.bin/xlint/lint1/makeman:1.4	Sun Sep  5 13:19:39 2021
+++ src/usr.bin/xlint/lint1/makeman	Sun Sep  5 13:46:31 2021
@@ -1,5 +1,5 @@
 #!/bin/sh
-#	$NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
+#	$NetBSD: makeman,v 1.5 2021/09/05 13:46:31 rillig Exp $
 #
 # Copyright (c) 2000 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -29,8 +29,8 @@
 # POSSIBILITY OF SUCH DAMAGE.
 
 
-cat << \__EOF
-.\"	$NetBSD: makeman,v 1.4 2021/09/05 13:19:39 rillig Exp $
+sed "s|@date@|$1|" << \__EOF
+.\"	$NetBSD: makeman,v 1.5 2021/09/05 13:46:31 rillig Exp $
 .\"
 .\" Copyright (c) 2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -58,14 +58,14 @@ cat << \__EOF
 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
-.Dd September 5, 2021
+.Dd @date@
 .Dt LINT 7
 .Os
 .Sh NAME
 .Nm lint
 .Nd Lint error message list
 .Sh DESCRIPTION
-The following is a list of message id's and messages produced by
+The following is a list of message IDs and messages produced by
 .Xr lint 1 .
 It is intended to be used with
 .Fl X
@@ -75,6 +75,7 @@ flag of
 .Bd -ragged -offset indent -compact
 .Bl -column "XXXX"
 __EOF
+shift
 "$@" | sed -e 's/^/.It /' -e 's/\\/\\e/g' -e "s/'/\\'/"
 echo ".El"
 echo ".Ed"

Reply via email to