Module Name:    src
Committed By:   christos
Date:           Tue Jun 16 00:45:56 UTC 2020

Modified Files:
        src/distrib/notes: Makefile.inc

Log Message:
For MKREPRO builds:
1. compute cur_date from the timestamp
2. pass the date to groff so that it can set its registers


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/distrib/notes/Makefile.inc

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

Modified files:

Index: src/distrib/notes/Makefile.inc
diff -u src/distrib/notes/Makefile.inc:1.54 src/distrib/notes/Makefile.inc:1.55
--- src/distrib/notes/Makefile.inc:1.54	Thu Jan 23 18:59:53 2020
+++ src/distrib/notes/Makefile.inc	Mon Jun 15 20:45:56 2020
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.54 2020/01/23 23:59:53 uwe Exp $
+#	$NetBSD: Makefile.inc,v 1.55 2020/06/16 00:45:56 christos Exp $
 #
 
 # Ross Harvey <[email protected]>
@@ -6,6 +6,11 @@
 .include <bsd.own.mk>	# So we get /etc/mk.conf vars.
 .include "${NETBSDSRCDIR}/distrib/common/Makefile.distrib"
 
+.if ${MKREPRO_TIMESTAMP:Uno} != "no"
+GROFF_TIMESTAMP=--timestamp=${MKREPRO_TIMESTAMP}
+DATE_TIMESTAMP=-r ${MKREPRO_TIMESTAMP}
+.endif
+
 # Whether or not to regenerate tables of contents
 #
 MKTOCS?=yes
@@ -55,7 +60,7 @@ curdate!=	env LANG="C" date -d "${BUILDI
 .if ${NETBSD_OFFICIAL_RELEASE:Uno} == "yes"
 .error "No release date could be derived from BUILDID"
 .else
-curdate!=	env LANG="C" date "+%b %d, %Y"
+curdate!=	env LANG="C" date ${DATE_TIMESTAMP} "+%b %d, %Y"
 .endif
 .endif
 PRESET+=	-dcur_date="${curdate}"
@@ -86,7 +91,7 @@ TOC.more=	${TOCS:M*.more.*}
 REMOVE_CREATION_DATE= ${TOOL_SED} -e '/^%%CreationDate:/d'
 
 ${TARG}.ps: ${SRCS} ${TOC.ps} ${DISTRIBVERDEP}
-	${TOOL_GROFF} ${ARGS_PS}   -mdoc      ${MAIN} \
+	${TOOL_GROFF} ${ARGS_PS} ${GROFF_TIMESTAMP} -mdoc      ${MAIN} \
 	    ${${MKREPRO:Uno} == "yes":? | ${REMOVE_CREATION_DATE} :} \
 	    > $@
 
@@ -94,13 +99,13 @@ ${TARG}.pdf: ${TARG}.ps
 	ps2pdf ${TARG}.ps $@
 
 ${TARG}.txt: ${SRCS} ${TOC.txt} ${DISTRIBVERDEP}
-	${TOOL_GROFF} ${ARGS_TXT}  -mdoc      ${MAIN} > $@
+	${TOOL_GROFF} ${ARGS_TXT} ${GROFF_TIMESTAMP}  -mdoc      ${MAIN} > $@
 
 ${TARG}.html: ${SRCS} ${TOC.html} ${DISTRIBVERDEP}
-	${TOOL_GROFF} ${ARGS_HTML} -mdoc2html ${MAIN} > $@
+	${TOOL_GROFF} ${ARGS_HTML} ${GROFF_TIMESTAMP} -mdoc2html ${MAIN} > $@
 
 ${TARG}.more: ${SRCS} ${TOC.more} ${DISTRIBVERDEP}
-	${TOOL_GROFF} ${ARGS_MORE} -mdoc      ${MAIN} > $@
+	${TOOL_GROFF} ${ARGS_MORE} ${GROFF_TIMESTAMP} -mdoc      ${MAIN} > $@
 
 
 # Rules to build the table of contents (.toc) files.  For the
@@ -108,21 +113,21 @@ ${TARG}.more: ${SRCS} ${TOC.more} ${DIST
 # space taken by the TOC itself.  Other versions are not paginated.
 
 ${TARG}.PostScript.toc: ${SRCS}
-	${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null
+	${TOOL_GROFF} -dTOC=1 ${ARGS_PS} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null
 	mv -f [email protected] $@
-	${TOOL_GROFF} -dTOC=1 ${ARGS_PS} -mdoc ${MAIN} > /dev/null
+	${TOOL_GROFF} -dTOC=1 ${ARGS_PS} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null
 	mv -f [email protected] $@
 
 ${TARG}.ASCII.toc: ${SRCS}
-	${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} -mdoc ${MAIN} > /dev/null
+	${TOOL_GROFF} -dTOC=1 ${ARGS_TXT} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null
 	mv -f [email protected] $@
 
 ${TARG}.HTML.toc: ${SRCS}
-	${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} -mdoc2html ${MAIN} > /dev/null
+	${TOOL_GROFF} -dTOC=1 ${ARGS_HTML} ${GROFF_TIMESTAMP} -mdoc2html ${MAIN} > /dev/null
 	mv -f [email protected] $@
 
 ${TARG}.more.toc: ${SRCS}
-	${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} -mdoc ${MAIN} > /dev/null
+	${TOOL_GROFF} -dTOC=1 ${ARGS_MORE} ${GROFF_TIMESTAMP} -mdoc ${MAIN} > /dev/null
 	mv -f [email protected] $@
 
 

Reply via email to