Module Name:    src
Committed By:   dholland
Date:           Sat Jul  5 19:22:05 UTC 2014

Modified Files:
        src/bin/csh/USD.doc: Makefile
        src/bin/sh/USD.doc: Makefile
        src/external/bsd/nvi/docs/USD.doc/edit: Makefile
        src/external/bsd/nvi/docs/USD.doc/exref: Makefile
        src/external/bsd/nvi/docs/USD.doc/vi.ref: Makefile
        src/external/bsd/nvi/docs/USD.doc/vitut: Makefile
        src/games/rogue: Makefile
        src/games/rogue/USD.doc: Makefile
        src/games/trek: Makefile
        src/games/trek/USD.doc: Makefile
        src/lib/libcurses/PSD.doc: Makefile
        src/sbin/fsck_ffs: Makefile
        src/sbin/fsck_ffs/SMM.doc: Makefile
        src/share/doc: Makefile
        src/share/doc/psd: Makefile
        src/share/doc/psd/05.sysman: Makefile
        src/share/doc/psd/20.ipctut: Makefile
        src/share/doc/psd/21.ipc: Makefile
        src/share/doc/smm: Makefile
        src/share/doc/smm/01.setup: Makefile
        src/share/doc/smm/04.quotas: Makefile
        src/share/doc/smm/05.fastfs: Makefile
        src/share/doc/smm/06.nfs: Makefile
        src/share/doc/smm/17.password: Makefile
        src/share/doc/smm/18.net: Makefile
        src/share/doc/smm/config: Makefile
        src/share/doc/usd: Makefile
        src/share/doc/usd/01.begin: Makefile
        src/share/doc/usd/17.msmacros: Makefile
        src/share/doc/usd/18.msdiffs: Makefile
        src/share/doc/usd/19.memacros: Makefile
        src/share/doc/usd/20.meref: Makefile
        src/share/mk: bsd.doc.mk bsd.own.mk
        src/usr.bin/gprof: Makefile
        src/usr.bin/gprof/PSD.doc: Makefile
        src/usr.bin/m4/PSD.doc: Makefile
        src/usr.bin/mail: Makefile
        src/usr.bin/mail/USD.doc: Makefile
        src/usr.bin/make: Makefile
        src/usr.bin/make/PSD.doc: Makefile
        src/usr.sbin/lpr: Makefile
        src/usr.sbin/lpr/SMM.doc: Makefile
        src/usr.sbin/timed: Makefile
        src/usr.sbin/timed/SMM.doc/timed: Makefile
        src/usr.sbin/timed/SMM.doc/timedop: Makefile
Added Files:
        src/bin/sh/USD.doc: referargs

Log Message:
Rework /usr/share/doc.

Update the <bsd.doc.mk> infrastructure, and update the docs to match
the new infrastructure.

- Build and install text, ps, pdf, and/or html, not roff sources.

- Don't wire the chapter numbers into the build system, or use them in
the installed pathnames. This didn't matter much when the docs were a
museum, but now that we're theoretically going to start maintaining
them again, we're going to add and remove documents periodically and
having the chapter numbers baked in creates a lot of thrashing for no
purpose.

- Specify the document name explicitly, rather than implicitly in a
path. Use this name (instead of other random strings) as the name
of the installed files.

- Specify the document section, which is the subdirectory of
/usr/share/doc to install into.

- Allow multiple subdocuments. (That is, multiple documents in one
output directory.)

- Enumerate the .png files groff emits along with html so they can be
installed.

- Remove assorted hand-rolled rules for running roff and roff widgetry
and add enough variable settings to make these unnecessary. This
includes support for
   - explicit use of soelim
   - refer
   - tbl
   - pic
   - eqn

- Forcibly apply at least minimal amounts of sanity to certain
autogenerated roff files.

- Don't exclude USD.doc, SMM.doc, and PSD.doc directories from the
build, as they now actually do stuff.

Note: currently we can't generate pdf. This turns out to be a
nontrivial problem with no immediate solution forthcoming. So for now,
as a workaround, install compressed .ps as the printable form.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/bin/csh/USD.doc/Makefile
cvs rdiff -u -r1.1 -r1.2 src/bin/sh/USD.doc/Makefile
cvs rdiff -u -r0 -r1.1 src/bin/sh/USD.doc/referargs
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/nvi/docs/USD.doc/edit/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/nvi/docs/USD.doc/exref/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/nvi/docs/USD.doc/vi.ref/Makefile
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/nvi/docs/USD.doc/vitut/Makefile
cvs rdiff -u -r1.18 -r1.19 src/games/rogue/Makefile
cvs rdiff -u -r1.5 -r1.6 src/games/rogue/USD.doc/Makefile
cvs rdiff -u -r1.14 -r1.15 src/games/trek/Makefile
cvs rdiff -u -r1.4 -r1.5 src/games/trek/USD.doc/Makefile
cvs rdiff -u -r1.10 -r1.11 src/lib/libcurses/PSD.doc/Makefile
cvs rdiff -u -r1.44 -r1.45 src/sbin/fsck_ffs/Makefile
cvs rdiff -u -r1.3 -r1.4 src/sbin/fsck_ffs/SMM.doc/Makefile
cvs rdiff -u -r1.10 -r1.11 src/share/doc/Makefile
cvs rdiff -u -r1.13 -r1.14 src/share/doc/psd/Makefile
cvs rdiff -u -r1.8 -r1.9 src/share/doc/psd/05.sysman/Makefile
cvs rdiff -u -r1.5 -r1.6 src/share/doc/psd/20.ipctut/Makefile
cvs rdiff -u -r1.5 -r1.6 src/share/doc/psd/21.ipc/Makefile
cvs rdiff -u -r1.20 -r1.21 src/share/doc/smm/Makefile
cvs rdiff -u -r1.12 -r1.13 src/share/doc/smm/01.setup/Makefile
cvs rdiff -u -r1.7 -r1.8 src/share/doc/smm/04.quotas/Makefile
cvs rdiff -u -r1.5 -r1.6 src/share/doc/smm/05.fastfs/Makefile
cvs rdiff -u -r1.2 -r1.3 src/share/doc/smm/06.nfs/Makefile
cvs rdiff -u -r1.1 -r1.2 src/share/doc/smm/17.password/Makefile
cvs rdiff -u -r1.5 -r1.6 src/share/doc/smm/18.net/Makefile
cvs rdiff -u -r1.1 -r1.2 src/share/doc/smm/config/Makefile
cvs rdiff -u -r1.24 -r1.25 src/share/doc/usd/Makefile
cvs rdiff -u -r1.1 -r1.2 src/share/doc/usd/01.begin/Makefile
cvs rdiff -u -r1.1 -r1.2 src/share/doc/usd/17.msmacros/Makefile
cvs rdiff -u -r1.3 -r1.4 src/share/doc/usd/18.msdiffs/Makefile
cvs rdiff -u -r1.2 -r1.3 src/share/doc/usd/19.memacros/Makefile
cvs rdiff -u -r1.2 -r1.3 src/share/doc/usd/20.meref/Makefile
cvs rdiff -u -r1.64 -r1.65 src/share/mk/bsd.doc.mk
cvs rdiff -u -r1.817 -r1.818 src/share/mk/bsd.own.mk
cvs rdiff -u -r1.27 -r1.28 src/usr.bin/gprof/Makefile
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/gprof/PSD.doc/Makefile
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/m4/PSD.doc/Makefile
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/mail/Makefile
cvs rdiff -u -r1.5 -r1.6 src/usr.bin/mail/USD.doc/Makefile
cvs rdiff -u -r1.56 -r1.57 src/usr.bin/make/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/PSD.doc/Makefile
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/lpr/Makefile
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/lpr/SMM.doc/Makefile
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/timed/Makefile
cvs rdiff -u -r1.5 -r1.6 src/usr.sbin/timed/SMM.doc/timed/Makefile
cvs rdiff -u -r1.2 -r1.3 src/usr.sbin/timed/SMM.doc/timedop/Makefile

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

Modified files:

Index: src/bin/csh/USD.doc/Makefile
diff -u src/bin/csh/USD.doc/Makefile:1.7 src/bin/csh/USD.doc/Makefile:1.8
--- src/bin/csh/USD.doc/Makefile:1.7	Thu Oct 18 18:26:31 2007
+++ src/bin/csh/USD.doc/Makefile	Sat Jul  5 19:22:02 2014
@@ -1,12 +1,12 @@
-#	$NetBSD: Makefile,v 1.7 2007/10/18 18:26:31 tls Exp $
+#	$NetBSD: Makefile,v 1.8 2014/07/05 19:22:02 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 8/14/93
 
-DIR=	usd/04.csh
+SECTION=usd
+ARTICLE=csh
 SRCS=	tabs csh.1 csh.2 csh.3 csh.4 csh.ap csh.g
 MACROS= -ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}                  
+EXTRAHTMLFILES=\
+	csh1.png csh2.png csh3.png csh4.png csh5.png csh6.png csh7.png \
+	csh8.png csh9.png
 
 .include <bsd.doc.mk>

Index: src/bin/sh/USD.doc/Makefile
diff -u src/bin/sh/USD.doc/Makefile:1.1 src/bin/sh/USD.doc/Makefile:1.2
--- src/bin/sh/USD.doc/Makefile:1.1	Sun Aug 22 01:58:16 2010
+++ src/bin/sh/USD.doc/Makefile	Sat Jul  5 19:22:02 2014
@@ -1,12 +1,12 @@
-#	$NetBSD: Makefile,v 1.1 2010/08/22 01:58:16 perry Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:02 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 8/14/93
 
-DIR=	usd/03.shell
-SRCS=	Rv7man t.mac t1 t2 t3 t4
-MACROS= -ms
-
-paper.ps: ${SRCS}
-	${TOOL_REFER} -e -p ${SRCS} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+SECTION=usd
+ARTICLE=shell
+SRCS=	referargs t.mac t1 t2 t3 t4
+MACROS=-ms
+ROFF_REFER=yes
+#REFER_ARGS=-e -p Rv7man
+EXTRAHTMLFILES=shell1.png shell2.png shell3.png shell4.png shell5.png
 
 .include <bsd.doc.mk>

Index: src/external/bsd/nvi/docs/USD.doc/edit/Makefile
diff -u src/external/bsd/nvi/docs/USD.doc/edit/Makefile:1.1 src/external/bsd/nvi/docs/USD.doc/edit/Makefile:1.2
--- src/external/bsd/nvi/docs/USD.doc/edit/Makefile:1.1	Fri Nov 22 16:00:45 2013
+++ src/external/bsd/nvi/docs/USD.doc/edit/Makefile	Sat Jul  5 19:22:02 2014
@@ -1,17 +1,18 @@
-#	$NetBSD: Makefile,v 1.1 2013/11/22 16:00:45 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:02 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
 .include "../../../Makefile.inc"
 .PATH: ${DIST}/docs/edit
-DIR=	usd/11.edit
+
+SECTION=usd
+ARTICLE=edit
 SRCS=	edittut.ms
 MACROS=	-ms
+ROFF_TBL=yes
+EXTRAHTMLFILES=edit1.png edit2.png edit3.png
 
-all: paper.ps
-
-paper.ps: ${SRCS}
-	${TOOL_TBL} ${.ALLSRC} | ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+.include <bsd.doc.mk>
 
 # index for versatec is different from the one in edit.tut
 # because the fonts are different and entries reference page
@@ -20,5 +21,3 @@ paper.ps: ${SRCS}
 
 editvindex:
 	${TOOL_ROFF_RAW} ${MACROS} -n22 edit.vindex
-
-.include <bsd.doc.mk>

Index: src/external/bsd/nvi/docs/USD.doc/exref/Makefile
diff -u src/external/bsd/nvi/docs/USD.doc/exref/Makefile:1.1 src/external/bsd/nvi/docs/USD.doc/exref/Makefile:1.2
--- src/external/bsd/nvi/docs/USD.doc/exref/Makefile:1.1	Fri Nov 22 16:00:45 2013
+++ src/external/bsd/nvi/docs/USD.doc/exref/Makefile	Sat Jul  5 19:22:02 2014
@@ -1,21 +1,23 @@
-#	$NetBSD: Makefile,v 1.1 2013/11/22 16:00:45 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:02 dholland Exp $
 #
 # @(#)Makefile	8.8 (Berkeley) 10/10/96
 
 .include "../../../Makefile.inc"
 .PATH: ${DIST}/docs/exref
 
-DIR=		usd/12.ex
-SRCS=		ex.rm ex.summary
+SECTION=	usd
+ARTICLE=	ex
+SUBARTICLES=	reference summary
+SRCS.reference=	ex.rm
+SRCS.summary=	ex.summary
 MACROS=		-ms
-CLEANFILES=	summary.ps
-
-all: paper.ps summary.ps
-
-paper.ps: ex.rm
-	${TOOL_TBL} ${.ALLSRC} | ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
-
-summary.ps: ex.summary
-	${TOOL_TBL} ${.ALLSRC} | ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=	yes
+EXTRAHTMLFILES= \
+	ex1.png  ex2.png  ex3.png  ex4.png  ex5.png  \
+	ex6.png  ex7.png  ex8.png  ex9.png  ex10.png \
+	ex11.png ex12.png ex13.png ex14.png ex15.png \
+	ex16.png ex17.png ex18.png ex19.png ex20.png \
+	ex21.png ex22.png ex23.png ex24.png ex25.png \
+	ex26.png ex27.png
 
 .include <bsd.doc.mk>

Index: src/external/bsd/nvi/docs/USD.doc/vi.ref/Makefile
diff -u src/external/bsd/nvi/docs/USD.doc/vi.ref/Makefile:1.1 src/external/bsd/nvi/docs/USD.doc/vi.ref/Makefile:1.2
--- src/external/bsd/nvi/docs/USD.doc/vi.ref/Makefile:1.1	Fri Nov 22 16:00:45 2013
+++ src/external/bsd/nvi/docs/USD.doc/vi.ref/Makefile	Sat Jul  5 19:22:02 2014
@@ -1,26 +1,19 @@
-#	$NetBSD: Makefile,v 1.1 2013/11/22 16:00:45 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:02 dholland Exp $
 #
 #	@(#)Makefile	8.20 (Berkeley) 8/18/96
 
-DIR=		usd/13.viref
-SRCS=		vi.ref ex.cmd.roff set.opt.roff vi.cmd.roff ref.so
+SECTION=	usd
+ARTICLE=	viref
+SRCS=		vi.ref
+DEPSRCS=	ex.cmd.roff set.opt.roff vi.cmd.roff ref.so index.so
 MACROS=		-me
-CLEANFILES+=	vi.ref.txt vi.ref.ps index index.so
+ROFF_TBL=	yes
+CLEANFILES+=	index index.so
 
-all: vi.ref.txt vi.ref.ps
-
-vi.ref.txt: vi.ref index.so
-	${TOOL_SOELIM} vi.ref | ${TOOL_TBL} | ${TOOL_ROFF_ASCII} ${MACROS} > $@
-	rm -f index
-	chmod 444 $@
-
-vi.ref.ps: vi.ref index.so
-	${TOOL_SOELIM} vi.ref | ${TOOL_TBL} | ${TOOL_ROFF_PS} ${MACROS} > $@
-	rm -f index
-	chmod 444 $@
+.include <bsd.doc.mk>
 
+# index.so is generated.
 index.so: vi.ref
-	# Build index.so, side-effect of building the paper.
 	${TOOL_SOELIM} vi.ref | ${TOOL_TBL} | \
 	    ${TOOL_ROFF_PS} ${MACROS} > /dev/null
 	sed -e 's/MINUSSIGN/\\-/' \
@@ -30,6 +23,3 @@ index.so: vi.ref
 	sort -u '-t	' +0 -1 +1n | awk -f merge.awk | \
 	sed -e 's/__SPACE/ /g' > $@
 	rm -f index
-	chmod 444 $@
-
-.include <bsd.doc.mk>

Index: src/external/bsd/nvi/docs/USD.doc/vitut/Makefile
diff -u src/external/bsd/nvi/docs/USD.doc/vitut/Makefile:1.1 src/external/bsd/nvi/docs/USD.doc/vitut/Makefile:1.2
--- src/external/bsd/nvi/docs/USD.doc/vitut/Makefile:1.1	Fri Nov 22 16:00:45 2013
+++ src/external/bsd/nvi/docs/USD.doc/vitut/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,26 +1,25 @@
-#	$NetBSD: Makefile,v 1.1 2013/11/22 16:00:45 christos Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.7 (Berkeley) 8/18/96
 
 .include "../../../Makefile.inc"
 .PATH: ${DIST}/docs/vitut
-DIR=		usd/12.vi
-SRCS=		vi.in vi.chars
-MACROS=		-ms
-CLEANFILES+=	vitut.ps summary.ps viapwh.ps
-
-all: vitut.ps summary.ps viapwh.ps
-
-vitut.ps: ${SRCS}
-	${TOOL_TBL} ${.ALLSRC} | ${TOOL_ROFF_PS} ${MACROS} > $@
-	chmod 444 $@
 
-summary.ps: vi.summary
-	${TOOL_TBL} ${.ALLSRC} | ${TOOL_ROFF_PS} ${MACROS} > $@
-	chmod 444 $@
-
-viapwh.ps: vi.apwh.ms
-	${TOOL_TBL} ${.ALLSRC} | ${TOOL_ROFF_PS} ${MACROS} > $@
-	chmod 444 $@
+SECTION=	usd
+ARTICLE=	vi
+SUBARTICLES=	vitut summary
+SRCS.vitut=	vi.in vi.chars
+SRCS.summary=	vi.summary
+SRCS.viapwh=	vi.apwh.ms
+MACROS=		-ms
+ROFF_TBL=	yes
+EXTRAHTMLFILES=	\
+	vi1.png  vi2.png  vi3.png  vi4.png  vi5.png  \
+	vi6.png  vi7.png  vi8.png  vi9.png  vi10.png \
+	vi11.png vi12.png vi13.png vi14.png vi15.png \
+	vi16.png vi17.png vi18.png vi19.png vi20.png \
+	vi21.png vi22.png vi23.png vi24.png vi25.png \
+	vi26.png vi27.png vi28.png vi29.png vi30.png \
+	vi31.png vi32.png vi33.png
 
 .include <bsd.doc.mk>

Index: src/games/rogue/Makefile
diff -u src/games/rogue/Makefile:1.18 src/games/rogue/Makefile:1.19
--- src/games/rogue/Makefile:1.18	Sun Aug 11 03:44:27 2013
+++ src/games/rogue/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.18 2013/08/11 03:44:27 dholland Exp $
+#	$NetBSD: Makefile,v 1.19 2014/07/05 19:22:03 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 
 PROG=	rogue
@@ -12,9 +12,7 @@ HIDEGAME=hidegame
 SETGIDGAME=yes
 MAN=	rogue.6
 
-.if make(install)
 SUBDIR+=USD.doc
-.endif
 
 .include <bsd.prog.mk>
 .include <bsd.subdir.mk>

Index: src/games/rogue/USD.doc/Makefile
diff -u src/games/rogue/USD.doc/Makefile:1.5 src/games/rogue/USD.doc/Makefile:1.6
--- src/games/rogue/USD.doc/Makefile:1.5	Sun Feb 17 12:17:40 2013
+++ src/games/rogue/USD.doc/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,11 +1,10 @@
-#	$NetBSD: Makefile,v 1.5 2013/02/17 12:17:40 jmcneill Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:03 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	usd/30.rogue
+SECTION=usd
+ARTICLE=rogue
 SRCS=	rogue.me
 MACROS=	-me
-
-paper.ps: ${SRCS}
-	${TOOL_TBL} ${SRCS} | ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
 
 .include <bsd.doc.mk>

Index: src/games/trek/Makefile
diff -u src/games/trek/Makefile:1.14 src/games/trek/Makefile:1.15
--- src/games/trek/Makefile:1.14	Tue Aug 16 11:28:18 2011
+++ src/games/trek/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.14 2011/08/16 11:28:18 christos Exp $
+#	$NetBSD: Makefile,v 1.15 2014/07/05 19:22:03 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 5/31/93
 
 PROG=	trek
@@ -15,9 +15,7 @@ DPADD=	${LIBM}
 LDADD=	-lm
 HIDEGAME=hidegame
 
-.if make(install)
 SUBDIR+=USD.doc
-.endif
 
 COPTS.getpar.c += -Wno-format-nonliteral
 

Index: src/games/trek/USD.doc/Makefile
diff -u src/games/trek/USD.doc/Makefile:1.4 src/games/trek/USD.doc/Makefile:1.5
--- src/games/trek/USD.doc/Makefile:1.4	Thu Jul 10 10:34:20 2003
+++ src/games/trek/USD.doc/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,11 +1,10 @@
-#	$NetBSD: Makefile,v 1.4 2003/07/10 10:34:20 lukem Exp $
+#	$NetBSD: Makefile,v 1.5 2014/07/05 19:22:03 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	usd/31.trek
+SECTION=usd
+ARTICLE=trek
 SRCS=	trek.me
 MACROS=	-me
-
-paper.ps: ${SRCS}
-	${TOOL_TBL} ${SRCS} | ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
 
 .include <bsd.doc.mk>

Index: src/lib/libcurses/PSD.doc/Makefile
diff -u src/lib/libcurses/PSD.doc/Makefile:1.10 src/lib/libcurses/PSD.doc/Makefile:1.11
--- src/lib/libcurses/PSD.doc/Makefile:1.10	Thu Jul 10 10:34:22 2003
+++ src/lib/libcurses/PSD.doc/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,17 +1,15 @@
-#	$NetBSD: Makefile,v 1.10 2003/07/10 10:34:22 lukem Exp $
+#	$NetBSD: Makefile,v 1.11 2014/07/05 19:22:03 dholland Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 5/23/94
 
-DIR=	psd/19.curses
+SECTION=psd
+ARTICLE=curses
 SRCS=	Master
-MACROS=	-me
-OTHER=	appen.A appen.B appen.C doc.I doc.II doc.III doc.IV fns.doc \
-	intro.0 intro.1 intro.3 intro.4 intro.5 intro.6 \
-	macros c_macros
 CEXAMPLES= ex1.gr ex2.gr life.gr twinkle1.gr twinkle2.gr win_st.gr
-TBLFILES=  intro.2.tbl
-EXTRA=	${OTHER} ${CEXAMPLES:R:S/$/.c/g} ${TBLFILES:R}
-
-CLEANFILES+= ${CEXAMPLES} ${TBLFILES}
+DEPSRCS=appen.A appen.B appen.C doc.I doc.II doc.III doc.IV fns.doc \
+	intro.0 intro.1 intro.2.tbl intro.3 intro.4 intro.5 intro.6 \
+	macros c_macros $(CEXAMPLES)
+MACROS=	-me
+CLEANFILES+= ${CEXAMPLES} intro.2.tbl
 
 .SUFFIXES:
 .SUFFIXES: .c .gr
@@ -29,10 +27,6 @@ VFONT=	/usr/libexec/vfontedpr
 .c.gr:
 	${VFONT} ${.IMPSRC} | grep -v "^'wh" > ${.TARGET}
 
-paper.ps: ${SRCS} ${OTHER} ${CEXAMPLES} ${TBLFILES}
-	${TOOL_SOELIM} -I${.CURDIR} Master | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
-
 # Unfortunately our make doesn't handle single-suffix rules.
 intro.2.tbl: intro.2
 	${TOOL_TBL} ${.ALLSRC} > ${.TARGET}

Index: src/sbin/fsck_ffs/Makefile
diff -u src/sbin/fsck_ffs/Makefile:1.44 src/sbin/fsck_ffs/Makefile:1.45
--- src/sbin/fsck_ffs/Makefile:1.44	Fri Aug 10 12:20:11 2012
+++ src/sbin/fsck_ffs/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.44 2012/08/10 12:20:11 joerg Exp $
+#	$NetBSD: Makefile,v 1.45 2014/07/05 19:22:03 dholland Exp $
 #	@(#)Makefile	8.2 (Berkeley) 4/27/95
 
 .include <bsd.own.mk>
@@ -36,9 +36,7 @@ COPTS.ffs_appleufs.c+=	-Wno-pointer-sign
 COPTS.pass1.c+=	-fno-tree-fre -fno-tree-lrs
 .endif
 
-.if make(install)
 SUBDIR+=SMM.doc
-.endif
 
 .include <bsd.prog.mk>
 .include <bsd.subdir.mk>

Index: src/sbin/fsck_ffs/SMM.doc/Makefile
diff -u src/sbin/fsck_ffs/SMM.doc/Makefile:1.3 src/sbin/fsck_ffs/SMM.doc/Makefile:1.4
--- src/sbin/fsck_ffs/SMM.doc/Makefile:1.3	Fri Apr  5 01:45:49 1996
+++ src/sbin/fsck_ffs/SMM.doc/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,8 +1,10 @@
-#	$NetBSD: Makefile,v 1.3 1996/04/05 01:45:49 cgd Exp $
+#	$NetBSD: Makefile,v 1.4 2014/07/05 19:22:03 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	smm/03.fsck_ffs
+SECTION=smm
+ARTICLE=fsck_ffs
 SRCS=	0.t 1.t 2.t 3.t 4.t
 MACROS=	-ms
+EXTRAHTMLFILES=fsck_ffs1.png fsck_ffs2.png fsck_ffs3.png fsck_ffs4.png
 
 .include <bsd.doc.mk>

Index: src/share/doc/Makefile
diff -u src/share/doc/Makefile:1.10 src/share/doc/Makefile:1.11
--- src/share/doc/Makefile:1.10	Mon Jan 19 07:50:20 2009
+++ src/share/doc/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,9 +1,7 @@
-#	$NetBSD: Makefile,v 1.10 2009/01/19 07:50:20 jmmv Exp $
+#	$NetBSD: Makefile,v 1.11 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/5/93
 
-.if make(install)
 SUBDIR+=	psd smm usd
-.endif
 
 .include <bsd.subdir.mk>

Index: src/share/doc/psd/Makefile
diff -u src/share/doc/psd/Makefile:1.13 src/share/doc/psd/Makefile:1.14
--- src/share/doc/psd/Makefile:1.13	Sun Jan 11 16:11:52 2004
+++ src/share/doc/psd/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2004/01/11 16:11:52 lukem Exp $
+#	$NetBSD: Makefile,v 1.14 2014/07/05 19:22:03 dholland Exp $
 #	@(#)Makefile	8.2 (Berkeley) 5/23/94
 
 .include <bsd.own.mk>
@@ -13,10 +13,6 @@
 # 01.cacm 02.implement 03.iosys 04.uprog 06.Clang 08.f77 09.f77io
 # 11.adb 15.yacc 16.lex
 
-BINDIR=	/usr/share/doc/psd
-.if ${MKDOC} != "no"
-FILES=	00.contents Makefile Title
-.endif
 SUBDIR=	05.sysman 20.ipctut 21.ipc
 .if exists(12.make)
 SUBDIR+= 12.make
@@ -31,8 +27,11 @@ SUBDIR+= 19.curses
 #	07.pascal 08.f77 09.f77io 11.adb 12.make 14.sccs 15.yacc \
 #	16.lex 17.m4 18.gprof 19.curses 20.ipctut 21.ipc
 
-Title.ps: ${FILES}
-	${TOOL_ROFF_PS} -ms Title > ${.TARGET}
+SECTION=psd
+SUBARTICLES=title contents
+SRCS.title=Title
+SRCS.contents=00.contents
+MACROS=-ms
 
-.include <bsd.prog.mk>
+.include <bsd.doc.mk>
 .include <bsd.subdir.mk>

Index: src/share/doc/psd/05.sysman/Makefile
diff -u src/share/doc/psd/05.sysman/Makefile:1.8 src/share/doc/psd/05.sysman/Makefile:1.9
--- src/share/doc/psd/05.sysman/Makefile:1.8	Sun Oct  6 05:45:19 2013
+++ src/share/doc/psd/05.sysman/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,16 +1,25 @@
-#	$NetBSD: Makefile,v 1.8 2013/10/06 05:45:19 dholland Exp $
+#	$NetBSD: Makefile,v 1.9 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.2 (Berkeley) 6/1/94
 
-DIR=	psd/05.sysman
+SECTION=psd
+ARTICLE=sysman
 SRCS=	0.t 1.0.t 1.1.t 1.2.t 1.3.t 1.4.t 1.5.t 1.6.t 1.7.t \
 	2.0.t 2.1.t 2.2.t 2.3.t 2.4.t 2.5.t a.t
+DEPSRCS=facilities contents
 MACROS=	-ms
+ROFF_TBL=yes
 CLEANFILES+=facilities contents pagelog
+EXTRAHTMLFILES=\
+	sysman1.png sysman2.png sysman3.png sysman4.png sysman5.png \
+	sysman6.png sysman7.png sysman8.png sysman9.png sysman10.png \
+	sysman11.png sysman12.png sysman13.png sysman14.png sysman15.png \
+	sysman16.png sysman17.png sysman18.png sysman19.png sysman20.png \
+	sysman21.png sysman22.png sysman23.png sysman24.png sysman25.png \
+	sysman26.png sysman27.png sysman28.png sysman29.png sysman30.png \
+	sysman31.png sysman32.png sysman33.png
 
-paper.ps: ${SRCS} facilities contents
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC:M*.t} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+.include <bsd.doc.mk>
 
 facilities: ${SRCS}
 	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} |\
@@ -21,5 +30,3 @@ contents: ${SRCS}
 	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} |\
 	    ${TOOL_SED} -n -e '/^\.Sh/p' |\
 	    ${TOOL_SED} -e 's/^\.Sh /.L/;s/$$/"/' > ${.TARGET}
-
-.include <bsd.doc.mk>

Index: src/share/doc/psd/20.ipctut/Makefile
diff -u src/share/doc/psd/20.ipctut/Makefile:1.5 src/share/doc/psd/20.ipctut/Makefile:1.6
--- src/share/doc/psd/20.ipctut/Makefile:1.5	Thu Jul 10 10:34:30 2003
+++ src/share/doc/psd/20.ipctut/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,16 +1,15 @@
-#	$NetBSD: Makefile,v 1.5 2003/07/10 10:34:30 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 8/14/93
 
-DIR=	psd/20.ipctut
+SECTION=psd
+ARTICLE=ipctut
 SRCS=	tutor.me
-MACROS=	-me
-EXTRA=	dgramread.c dgramsend.c fig2.pic fig3.pic fig8.pic pipe.c \
+DEPSRCS=dgramread.c dgramsend.c fig2.pic fig3.pic fig8.pic pipe.c \
 	socketpair.c strchkread.c streamread.c streamwrite.c \
 	udgramread.c udgramsend.c ustreamread.c ustreamwrite.c
-
-paper.ps: ${SRCS} ${EXTRA}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC:M*.me} | ${TOOL_PIC} | \
-	    ${TOOL_TBL} | ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+MACROS=	-me
+ROFF_PIC=yes
+ROFF_TBL=yes
 
 .include <bsd.doc.mk>

Index: src/share/doc/psd/21.ipc/Makefile
diff -u src/share/doc/psd/21.ipc/Makefile:1.5 src/share/doc/psd/21.ipc/Makefile:1.6
--- src/share/doc/psd/21.ipc/Makefile:1.5	Thu Jul 10 10:34:31 2003
+++ src/share/doc/psd/21.ipc/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,13 +1,11 @@
-#	$NetBSD: Makefile,v 1.5 2003/07/10 10:34:31 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	psd/21.ipc
+SECTION=psd
+ARTICLE=ipc
 SRCS=	0.t 1.t 2.t 3.t 4.t 5.t
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
 
 .include <bsd.doc.mk>

Index: src/share/doc/smm/Makefile
diff -u src/share/doc/smm/Makefile:1.20 src/share/doc/smm/Makefile:1.21
--- src/share/doc/smm/Makefile:1.20	Thu Nov 29 12:35:05 2007
+++ src/share/doc/smm/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.20 2007/11/29 12:35:05 mjf Exp $
+#	$NetBSD: Makefile,v 1.21 2014/07/05 19:22:04 dholland Exp $
 #	from: @(#)Makefile	8.2 (Berkeley) 5/10/94
 
 .include <bsd.own.mk>
@@ -6,17 +6,10 @@
 # The following modules do not build/install:
 # 10.named, 13.amd
 
-# Missing:
-# 02.config
-
 # Missing from 4.4BSD-Lite:
 # 14.uucpimpl 15.uucpnet 16.security
 
-BINDIR=	/usr/share/doc/smm
-.if ${MKDOC} != "no"
-FILES=	00.contents Makefile Title
-.endif
-SUBDIR=	01.setup 04.quotas 05.fastfs 06.nfs 17.password 18.net
+SUBDIR=	01.setup config 04.quotas 05.fastfs 06.nfs 17.password 18.net
 .if exists(03.fsck_ffs)
 SUBDIR+= 03.fsck_ffs
 .endif
@@ -33,11 +26,11 @@ SUBDIR+= 09.sendmail
 #	08.sendmailop 09.sendmail 14.uucpimpl \
 #	15.uucpnet 16.security 17.password 18.net 19.perl
 
-Title.ps: ${FILES}
-	${TOOL_ROFF_PS} -ms Title > ${.TARGET}
-
-contents.ps: ${FILES}
-	${TOOL_ROFF_PS} -ms 00.contents > ${.TARGET}
+SECTION=smm
+SUBARTICLES=title contents
+SRCS.title=Title
+SRCS.contents=00.contents
+MACROS=-ms
 
-.include <bsd.prog.mk>
+.include <bsd.doc.mk>
 .include <bsd.subdir.mk>

Index: src/share/doc/smm/01.setup/Makefile
diff -u src/share/doc/smm/01.setup/Makefile:1.12 src/share/doc/smm/01.setup/Makefile:1.13
--- src/share/doc/smm/01.setup/Makefile:1.12	Thu Jul 10 10:34:32 2003
+++ src/share/doc/smm/01.setup/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,14 +1,21 @@
-#	$NetBSD: Makefile,v 1.12 2003/07/10 10:34:32 lukem Exp $
+#	$NetBSD: Makefile,v 1.13 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 7/27/93
 
-DIR=	smm/01.setup
+SECTION=smm
+ARTICLE=setup
 SRCS=	0.t 1.t 2.t 3.t 4.t 5.t 6.t
-FILES=	${SRCS}
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
+EXTRAHTMLFILES=\
+	setup1.png setup2.png setup3.png setup4.png setup5.png \
+	setup6.png setup7.png setup8.png setup9.png setup10.png \
+	setup11.png setup12.png setup13.png setup14.png setup15.png \
+	setup16.png setup17.png setup18.png setup19.png setup20.png \
+	setup21.png setup22.png setup23.png setup24.png setup25.png \
+	setup26.png setup27.png setup28.png setup29.png setup30.png \
+	setup31.png setup32.png setup33.png setup34.png setup35.png \
+	setup36.png setup37.png setup38.png setup39.png setup40.png \
+	setup41.png setup42.png setup43.png setup44.png setup45.png
 
 .include <bsd.doc.mk>

Index: src/share/doc/smm/04.quotas/Makefile
diff -u src/share/doc/smm/04.quotas/Makefile:1.7 src/share/doc/smm/04.quotas/Makefile:1.8
--- src/share/doc/smm/04.quotas/Makefile:1.7	Fri Jan  9 06:55:27 1998
+++ src/share/doc/smm/04.quotas/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.7 1998/01/09 06:55:27 perry Exp $
+#	$NetBSD: Makefile,v 1.8 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	smm/04.quotas
+SECTION=smm
+ARTICLE=quotas
 SRCS=	quotas.ms
 MACROS=	-ms
 

Index: src/share/doc/smm/05.fastfs/Makefile
diff -u src/share/doc/smm/05.fastfs/Makefile:1.5 src/share/doc/smm/05.fastfs/Makefile:1.6
--- src/share/doc/smm/05.fastfs/Makefile:1.5	Thu Jul 10 10:34:32 2003
+++ src/share/doc/smm/05.fastfs/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,13 +1,17 @@
-#	$NetBSD: Makefile,v 1.5 2003/07/10 10:34:32 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	smm/05.fastfs
+SECTION=smm
+ARTICLE=fastfs
 SRCS=	0.t 1.t 2.t 3.t 4.t 5.t 6.t
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | ${TOOL_EQN} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
+ROFF_EQN=yes
+EXTRAHTMLFILES=\
+	fastfs1.png fastfs2.png fastfs3.png fastfs4.png fastfs5.png \
+	fastfs6.png fastfs7.png fastfs8.png fastfs9.png fastfs10.png \
+	fastfs11.png fastfs12.png fastfs13.png fastfs14.png fastfs15.png \
+	fastfs16.png fastfs-9.png
 
 .include <bsd.doc.mk>

Index: src/share/doc/smm/06.nfs/Makefile
diff -u src/share/doc/smm/06.nfs/Makefile:1.2 src/share/doc/smm/06.nfs/Makefile:1.3
--- src/share/doc/smm/06.nfs/Makefile:1.2	Fri Jan  9 06:55:38 1998
+++ src/share/doc/smm/06.nfs/Makefile	Sat Jul  5 19:22:03 2014
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.2 1998/01/09 06:55:38 perry Exp $
+#	$NetBSD: Makefile,v 1.3 2014/07/05 19:22:03 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	smm/06.nfs
+SECTION=smm
+ARTICLE=nfs
 SRCS=	0.t 1.t 2.t ref.t
 MACROS=	-me
 

Index: src/share/doc/smm/17.password/Makefile
diff -u src/share/doc/smm/17.password/Makefile:1.1 src/share/doc/smm/17.password/Makefile:1.2
--- src/share/doc/smm/17.password/Makefile:1.1	Thu Nov 29 12:35:05 2007
+++ src/share/doc/smm/17.password/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,7 +1,9 @@
-#	$NetBSD: Makefile,v 1.1 2007/11/29 12:35:05 mjf Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:04 dholland Exp $
 
-DIR=	smm/17.password
+SECTION=smm
+ARTICLE=password
 SRCS=	password.ms
 MACROS=	-ms
+EXTRAHTMLFILES=password1.png
 
 .include <bsd.doc.mk>

Index: src/share/doc/smm/18.net/Makefile
diff -u src/share/doc/smm/18.net/Makefile:1.5 src/share/doc/smm/18.net/Makefile:1.6
--- src/share/doc/smm/18.net/Makefile:1.5	Thu Jul 10 10:34:32 2003
+++ src/share/doc/smm/18.net/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,13 +1,12 @@
-#	$NetBSD: Makefile,v 1.5 2003/07/10 10:34:32 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:04 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/10/93
 
-DIR=	smm/18.net
+SECTION=smm
+ARTICLE=net
 SRCS=	0.t 1.t 2.t 3.t 4.t 5.t 6.t 7.t 8.t 9.t a.t b.t c.t d.t e.t f.t
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
+EXTRAHTMLFILES=net1.png net2.png net3.png net4.png
 
 .include <bsd.doc.mk>

Index: src/share/doc/smm/config/Makefile
diff -u src/share/doc/smm/config/Makefile:1.1 src/share/doc/smm/config/Makefile:1.2
--- src/share/doc/smm/config/Makefile:1.1	Tue Dec 18 03:35:53 2007
+++ src/share/doc/smm/config/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,14 +1,12 @@
-#	$NetBSD: Makefile,v 1.1 2007/12/18 03:35:53 garbled Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:04 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 7/27/93
 
-DIR=	smm/config
+SECTION=smm
+ARTICLE=config
 SRCS=	0.t 1.t 2.t 3.t 4.t 5.t 6.t a.t b.t c.t d.t e.t
-FILES=	${SRCS}
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
+EXTRAHTMLFILES=config1.png config2.png config3.png config4.png config5.png
 
 .include <bsd.doc.mk>

Index: src/share/doc/usd/Makefile
diff -u src/share/doc/usd/Makefile:1.24 src/share/doc/usd/Makefile:1.25
--- src/share/doc/usd/Makefile:1.24	Thu Nov 29 12:35:05 2007
+++ src/share/doc/usd/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.24 2007/11/29 12:35:05 mjf Exp $
+#	$NetBSD: Makefile,v 1.25 2014/07/05 19:22:04 dholland Exp $
 #
 #	@(#)Makefile	8.3 (Berkeley) 5/16/94
 
@@ -15,21 +15,15 @@
 # 16.awk 21.troff 22.trofftut 23.eqn 24.eqnguide
 # 25.tbl 26.refer 27.invert 29.diction
 
-BINDIR=	/usr/share/doc/usd
-.if ${MKDOC} != "no"
-FILES=	00.contents Makefile Title
-.endif
 SUBDIR+=01.begin 17.msmacros 18.msdiffs 19.memacros 20.meref
-.if !make(install)
-SUBDIR+=04.csh 07.mail 11.edit 12.ex 13.viref
-SUBDIR+=30.rogue 31.trek
-.endif
+#SUBDIR+=04.csh 07.mail 11.edit 12.ex 13.viref
+#SUBDIR+=30.rogue 31.trek
 
-Title.ps: ${FILES}
-	${TOOL_ROFF_PS} -ms Title > ${.TARGET}
+SECTION=usd
+SUBARTICLES=title contents
+SRCS.title=Title
+SRCS.contents=00.contents
+MACROS=-ms
 
-contents.ps: ${FILES}
-	${TOOL_ROFF_PS} -ms 00.contents > ${.TARGET}
-
-.include <bsd.prog.mk>
+.include <bsd.doc.mk>
 .include <bsd.subdir.mk>

Index: src/share/doc/usd/01.begin/Makefile
diff -u src/share/doc/usd/01.begin/Makefile:1.1 src/share/doc/usd/01.begin/Makefile:1.2
--- src/share/doc/usd/01.begin/Makefile:1.1	Thu Nov 29 12:35:05 2007
+++ src/share/doc/usd/01.begin/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,7 +1,12 @@
-#       $NetBSD: Makefile,v 1.1 2007/11/29 12:35:05 mjf Exp $
+#       $NetBSD: Makefile,v 1.2 2014/07/05 19:22:04 dholland Exp $
 
-DIR=	usd/01.begin
+SECTION=usd
+ARTICLE=begin
 SRCS=	u.mac u0 u1 u2 u3 u4 u5
 MACROS= -ms
+EXTRAHTMLFILES=\
+	begin1.png begin2.png begin3.png begin4.png begin5.png \
+	begin6.png begin7.png begin8.png begin9.png begin10.png \
+	begin11.png begin12.png begin13.png begin14.png 
 
 .include <bsd.doc.mk>

Index: src/share/doc/usd/17.msmacros/Makefile
diff -u src/share/doc/usd/17.msmacros/Makefile:1.1 src/share/doc/usd/17.msmacros/Makefile:1.2
--- src/share/doc/usd/17.msmacros/Makefile:1.1	Thu Nov 29 12:35:07 2007
+++ src/share/doc/usd/17.msmacros/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,11 +1,14 @@
-#	$NetBSD: Makefile,v 1.1 2007/11/29 12:35:07 mjf Exp $
+#	$NetBSD: Makefile,v 1.2 2014/07/05 19:22:04 dholland Exp $
 
-DIR=	usd/17.msmacros
+SECTION=usd
+ARTICLE=msmacros
 SRCS=	ms fig1.pic
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} ${SRCS} | ${TOOL_PIC} | ${TOOL_TBL} | ${TOOL_EQN} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_PIC=yes
+ROFF_TBL=yes
+ROFF_EQN=yes
+EXTRAHTMLFILES=\
+	msmacros1.png msmacros2.png msmacros3.png msmacros4.png msmacros5.png \
+	msmacros6.png msmacros7.png msmacros8.png msmacros9.png 
 
 .include <bsd.doc.mk>

Index: src/share/doc/usd/18.msdiffs/Makefile
diff -u src/share/doc/usd/18.msdiffs/Makefile:1.3 src/share/doc/usd/18.msdiffs/Makefile:1.4
--- src/share/doc/usd/18.msdiffs/Makefile:1.3	Fri Jan  9 06:55:57 1998
+++ src/share/doc/usd/18.msdiffs/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,9 +1,11 @@
-#	$NetBSD: Makefile,v 1.3 1998/01/09 06:55:57 perry Exp $
+#	$NetBSD: Makefile,v 1.4 2014/07/05 19:22:04 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	usd/18.msdiffs
+SECTION=usd
+ARTICLE=msdiffs
 SRCS=	ms.diffs
 MACROS=	-ms
+EXTRAHTMLFILES=msdiffs1.png msdiffs2.png
 
 .include <bsd.doc.mk>

Index: src/share/doc/usd/19.memacros/Makefile
diff -u src/share/doc/usd/19.memacros/Makefile:1.2 src/share/doc/usd/19.memacros/Makefile:1.3
--- src/share/doc/usd/19.memacros/Makefile:1.2	Fri Jan  9 06:55:59 1998
+++ src/share/doc/usd/19.memacros/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.2 1998/01/09 06:55:59 perry Exp $
+#	$NetBSD: Makefile,v 1.3 2014/07/05 19:22:04 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	usd/19.memacros
+SECTION=usd
+ARTICLE=memacros
 SRCS=	intro.me
 MACROS=	-me
 

Index: src/share/doc/usd/20.meref/Makefile
diff -u src/share/doc/usd/20.meref/Makefile:1.2 src/share/doc/usd/20.meref/Makefile:1.3
--- src/share/doc/usd/20.meref/Makefile:1.2	Fri Jan  9 06:56:02 1998
+++ src/share/doc/usd/20.meref/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,8 +1,9 @@
-#	$NetBSD: Makefile,v 1.2 1998/01/09 06:56:02 perry Exp $
+#	$NetBSD: Makefile,v 1.3 2014/07/05 19:22:04 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	usd/20.meref
+SECTION=usd
+ARTICLE=meref
 SRCS=	ref.me
 MACROS=	-me
 

Index: src/share/mk/bsd.doc.mk
diff -u src/share/mk/bsd.doc.mk:1.64 src/share/mk/bsd.doc.mk:1.65
--- src/share/mk/bsd.doc.mk:1.64	Thu Mar 16 18:43:34 2006
+++ src/share/mk/bsd.doc.mk	Sat Jul  5 19:22:04 2014
@@ -1,72 +1,215 @@
-#	$NetBSD: bsd.doc.mk,v 1.64 2006/03/16 18:43:34 jwise Exp $
+#	$NetBSD: bsd.doc.mk,v 1.65 2014/07/05 19:22:04 dholland Exp $
 #	@(#)bsd.doc.mk	8.1 (Berkeley) 8/14/93
 
 .include <bsd.init.mk>
 
-##### Basic targets
-clean:		cleandoc
-realinstall:	docinstall
-
-##### Build rules
-.if !target(paper.ps)
-paper.ps: ${SRCS}
-	${_MKTARGET_FORMAT}
-	${TOOL_ROFF_PS} ${MACROS} ${PAGES} ${.ALLSRC} > ${.TARGET}
-.endif
-
-.if ${MKSHARE} != "no"
-realall:	paper.ps
-.endif
+# The makefile should set these:
+#   SECTION		one of usd, smm, or psd (lower-case)
+#   ARTICLE		name of this document
+#   SRCS		roff source files
+#   DEPSRCS		additional roff source files implicitly included
+#   MACROS		name(s) of roff macro packages, including the -m
+#   ROFF_PIC		set to "yes" to use pic(1)
+#   ROFF_EQN		set to "yes" to use eqn(1)
+#   ROFF_TBL		set to "yes" to use tbl(1)
+#   ROFF_REFER		set to "yes" to use refer(1)
+#   EXTRAHTMLFILES	additional files emitted as part of HTML build
+#
+#   PAGES		unknown (XXX)
+#   EXTRA		extra files to install (XXX)
+#
+# If there are multiple docs to be generated, set these:
+#   SUBARTICLES=	name1 name2 ...
+#   SRCS.name1=		roff source files
+#   SRCS.name2=		more roff source files
+#   SRCS.  :  =		  :
+#   DEPSRCS.name1=	additional included roff source files
+#   DEPSRCS.name2=	more additional included roff source files
+#   DEPSRCS.  :  =	  :
+#
+# I'm hoping that MACROS and ROFF_* can be uniform across all
+# subarticles.
+
+
+# Old bsd.doc.mk files tend to invoke tbl and other preprocessors
+# directly; they should be changed to set ROFF_* instead.
+#
+# Also they set e.g. DIR=usd/72.mydocument; this should be changed
+# to SECTION=usd and ARTICLE=mydocument. The article numbers are
+# no longer present in the file system and do not need to be known
+# at build time.
+#
+
+# 20130908 dholland: Make sure all makefiles have been converted to the
+# new scheme.
+.if !defined(SECTION)
+.error "bsd.doc.mk: SECTION must be defined"
+.endif
+.if target(paper.ps)
+.error "bsd.doc.mk: target(paper.ps) is true -- this is not allowed"
+.endif
+
+# 20130908 dholland: right now we cannot generate pdf from roff sources,
+# so build compressed postscript instead. XXX. (and: yech)
+TOOL_ROFF_PDF?=false "No roff pdf support"
+PRINTABLE=ps.gz
+#PRINTABLE=ps
+#PRINTABLE=pdf
+
+# If there aren't subarticles, we generate one doc that has the same
+# name as the top-level article.
+SUBARTICLES?=${ARTICLE}
+SRCS.${ARTICLE}?=${SRCS}
+DEPSRCS.${ARTICLE}?=${DEPSRCS}
 
-##### Install rules
-docinstall::	# ensure existence
-.PHONY:		docinstall
+##### Build
 
+.for SA in ${SUBARTICLES}
 .if ${MKDOC} != "no"
+realall: ${SA}.txt
+realall: ${SA}.${PRINTABLE}
+.if ${MKHTML} != "no"
+realall: ${SA}.html
+.endif
+.endif
+.endfor # SUBARTICLES
+
+.if defined(ROFF_PIC) && ${ROFF_PIC} != "no"
+ROFFFLAGS+=-p
+.endif
+.if defined(ROFF_EQN) && ${ROFF_EQN} != "no"
+ROFFFLAGS+=-e
+.endif
+.if defined(ROFF_TBL) && ${ROFF_TBL} != "no"
+ROFFFLAGS+=-t
+.endif
+.if defined(ROFF_REFER) && ${ROFF_REFER} != "no"
+ROFFFLAGS+=-R
+.endif
+ROFFFLAGS+=-I${.CURDIR}
+
+.for SA in ${SUBARTICLES}
+
+#
+# Find the sources.
+#
+# We can't use .IMPSRC in the rules because they aren't suffix rules
+# (they could be for some docs, but not others) and we can't use
+# .ALLSRC because that includes DEPSRCS.
+#
+# As far as I know, the only ways to get the path discovered via .PATH
+# are those two magic variables or the P modifier.
+#
+# For some reason the P modifier finds the path to a variable name,
+# not the path to a word in a variable.
+#
 
-__docinstall: .USE
-	${_MKTARGET_INSTALL}
-	${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
-		${.ALLSRC} ${.TARGET}
+.for S in ${SRCS.${SA}}
+SRCS2.${SA}+=${${S}:P}
+.endfor
+.for S in ${DEPSRCS.${SA}}
+DEPSRCS2.${SA}+=${${S}:P}
+.endfor
+
+#
+# Note: we use TOOL_ROFF_DOCASCII because TOOL_ROFF_ASCII invokes
+# the nroff wrapper instead of groff directly, and that doesn't
+# understand -I.
+#
+# We use TOOL_ROFF_DOCHTML because TOOL_ROFF_HTML uses -mdoc2html,
+# which is great if it works but doesn't work with at least some of
+# the non-mdoc docs. (e.g. the curses one) TOOL_ROFF_DOCHTML uses
+# groff -Thtml, which produces fairly blah output but works with these
+# docs. It might end up being necessary to choose one or the other on
+# a per-document basis... sigh.
+#
+
+${SA}.txt: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_DOCASCII} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		> ${.TARGET}
 
-FILES?=		${SRCS}
+${SA}.ps: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_PS} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		> ${.TARGET}
 
-.for F in Makefile ${FILES:O:u} ${EXTRA}
-_F:=		${DESTDIR}${DOCDIR}/${DIR}/${F}		# installed path
+${SA}.pdf: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_PDF} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		> ${.TARGET}
 
-.if ${MKUPDATE} == "no"
-${_F}!		${F} __docinstall			# install rule
-.if !defined(BUILD) && !make(all) && !make(${F})
-${_F}!		.MADE					# no build at install
+${SA}.html: ${SRCS2.${SA}} ${DEPSRCS2.${SA}}
+	${_MKTARGET_FORMAT}
+	${TOOL_ROFF_DOCHTML} ${ROFFFLAGS} ${MACROS} ${PAGES} ${SRCS2.${SA}} \
+		-P -I -P ${SA} \
+		> ${.TARGET}
+
+${SA}.ps.gz: ${SA}.ps
+	${TOOL_GZIP} -9 -c ${.ALLSRC} > ${.TARGET}
+
+.endfor # SUBARTICLES
+
+##### Install
+
+DOCINST:=
+.for SA in ${SUBARTICLES}
+DOCINST+=${SA}.txt ${SA}.${PRINTABLE}
+.if ${MKHTML} != "no"
+DOCINST+=${SA}.html
 .endif
+.endfor
+DOCINST+=${EXTRAHTMLFILES}
+
+.if ${MKDOC} != "no"
+docinstall:
+.for D in ${DOCINST}
+	${_MKTARGET_INSTALL}
+	${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} ${D} \
+		${DESTDIR}${DOCDIR}/${SECTION}/${ARTICLE}/${D}
+.endfor
 .else
-${_F}:		${F} __docinstall			# install rule
-.if !defined(BUILD) && !make(all) && !make(${F})
-${_F}:		.MADE					# no build at install
-.endif
+docinstall: ;
 .endif
 
-docinstall::	${_F}
-.PRECIOUS:	${_F}					# keep if install fails
+.PHONY: docinstall
+realinstall: docinstall
+
+##### Clean
+
+cleandoc:
+.for SA in ${SUBARTICLES}
+	rm -f ${SA}.txt ${SA}.ps ${SA}.ps.gz ${SA}.html
 .endfor
+	rm -f ${EXTRAHTMLFILES} [eE]rrs mklog ${CLEANFILES}
 
-.undef _F
-.endif # ${MKDOC} != "no"
+.PHONY: cleandoc
+clean: cleandoc
 
-##### Clean rules
-cleandoc: .PHONY
-	rm -f paper.* [eE]rrs mklog ${CLEANFILES}
+##### Extra custom rules
 
-##### Custom rules
 .if !target(print)
-print: .PHONY paper.ps
+print: ;
+.PHONY: print
+.for SA in ${SUBARTICLES}
+print: print.${SA}
+.PHONY: print.{SA}
+print.${SA}: ${SA}.ps
 	lpr -P${PRINTER} ${.ALLSRC}
+.endfor
 .endif
 
-spell: .PHONY ${SRCS}
-	spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
+spell: ;
+.PHONY: spell
+.for SA in ${SUBARTICLES}
+spell: spell.${SA}
+.PHONY: spell.{SA}
+spell.${SA}: ${SRCS2} ${DEPSRCS2}
+	spell ${SRCS2} | sort | comm -23 - spell.ok > paper.spell
+.endfor
 
 ##### Pull in related .mk logic
+
 .include <bsd.obj.mk>
 .include <bsd.sys.mk>
 

Index: src/share/mk/bsd.own.mk
diff -u src/share/mk/bsd.own.mk:1.817 src/share/mk/bsd.own.mk:1.818
--- src/share/mk/bsd.own.mk:1.817	Sun Jun 29 15:10:17 2014
+++ src/share/mk/bsd.own.mk	Sat Jul  5 19:22:04 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: bsd.own.mk,v 1.817 2014/06/29 15:10:17 mrg Exp $
+#	$NetBSD: bsd.own.mk,v 1.818 2014/07/05 19:22:04 dholland Exp $
 
 # This needs to be before bsd.init.mk
 .if defined(BSD_MK_COMPAT_FILE)
@@ -359,6 +359,8 @@ TOOL_POWERPCMKBOOTIMAGE=${TOOLDIR}/bin/$
 TOOL_PWD_MKDB=		${TOOLDIR}/bin/${_TOOL_PREFIX}pwd_mkdb
 TOOL_REFER=		${TOOLDIR}/bin/${_TOOL_PREFIX}refer
 TOOL_ROFF_ASCII=	PATH=${TOOLDIR}/lib/groff:$${PATH} ${TOOLDIR}/bin/${_TOOL_PREFIX}nroff
+TOOL_ROFF_DOCASCII=	${TOOL_GROFF} -Tascii
+TOOL_ROFF_DOCHTML=	${TOOL_GROFF} -Thtml
 TOOL_ROFF_DVI=		${TOOL_GROFF} -Tdvi
 TOOL_ROFF_HTML=		${TOOL_GROFF} -Tlatin1 -mdoc2html
 TOOL_ROFF_PS=		${TOOL_GROFF} -Tps
@@ -461,6 +463,8 @@ TOOL_POWERPCMKBOOTIMAGE=	powerpc-mkbooti
 TOOL_PWD_MKDB=		pwd_mkdb
 TOOL_REFER=		refer
 TOOL_ROFF_ASCII=	nroff
+TOOL_ROFF_DOCASCII=	${TOOL_GROFF} -Tascii
+TOOL_ROFF_DOCHTML=	${TOOL_GROFF} -Thtml
 TOOL_ROFF_DVI=		${TOOL_GROFF} -Tdvi
 TOOL_ROFF_HTML=		${TOOL_GROFF} -Tlatin1 -mdoc2html
 TOOL_ROFF_PS=		${TOOL_GROFF} -Tps

Index: src/usr.bin/gprof/Makefile
diff -u src/usr.bin/gprof/Makefile:1.27 src/usr.bin/gprof/Makefile:1.28
--- src/usr.bin/gprof/Makefile:1.27	Tue Feb  9 18:28:10 1999
+++ src/usr.bin/gprof/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,7 +1,3 @@
-#	$NetBSD: Makefile,v 1.27 1999/02/09 18:28:10 tv Exp $
-
-.if make(install)
-SUBDIR=	PSD.doc
-.endif
+#	$NetBSD: Makefile,v 1.28 2014/07/05 19:22:04 dholland Exp $
 
 .include <bsd.subdir.mk>

Index: src/usr.bin/gprof/PSD.doc/Makefile
diff -u src/usr.bin/gprof/PSD.doc/Makefile:1.6 src/usr.bin/gprof/PSD.doc/Makefile:1.7
--- src/usr.bin/gprof/PSD.doc/Makefile:1.6	Thu Jul 10 10:34:44 2003
+++ src/usr.bin/gprof/PSD.doc/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,15 +1,18 @@
-#	$NetBSD: Makefile,v 1.6 2003/07/10 10:34:44 lukem Exp $
+#	$NetBSD: Makefile,v 1.7 2014/07/05 19:22:04 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 8/14/93
 
-DIR=	psd/18.gprof
+SECTION=psd
+ARTICLE=gprof
 SRCS=	header.me abstract.me intro.me profiling.me gathering.me \
 	postp.me present.me refs.me
-EXTRA=	postp1.pic postp2.pic postp3.pic pres1.pic pres2.pic
-DPADD=	${EXTRA}
+DEPSRCS=postp1.pic postp2.pic postp3.pic pres1.pic pres2.pic
 MACROS=	-me
-
-paper.ps: ${SRCS} ${DPADD}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC:M*.me} | ${TOOL_PIC} | \
-	    ${TOOL_TBL} | ${TOOL_EQN} | ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_PIC=yes
+ROFF_EQN=yes
+ROFF_TBL=yes
+EXTRAHTMLFILES=\
+	gprof-1.png gprof-2.png gprof-3.png gprof-4.png gprof-5.png \
+	gprof-6.png gprof-7.png gprof-8.png gprof-9.png gprof-10.png \
+	gprof-11.png gprof-12.png gprof-13.png gprof-14.png
 
 .include <bsd.doc.mk>

Index: src/usr.bin/m4/PSD.doc/Makefile
diff -u src/usr.bin/m4/PSD.doc/Makefile:1.3 src/usr.bin/m4/PSD.doc/Makefile:1.4
--- src/usr.bin/m4/PSD.doc/Makefile:1.3	Thu Jul 10 10:34:44 2003
+++ src/usr.bin/m4/PSD.doc/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,12 +1,10 @@
-#	$NetBSD: Makefile,v 1.3 2003/07/10 10:34:44 lukem Exp $
+#	$NetBSD: Makefile,v 1.4 2014/07/05 19:22:04 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	psd/17.m4
+SECTION=psd
+ARTICLE=m4
 SRCS=	m4.ms
 MACROS=	-msU
 
-paper.ps: ${SRCS}
-	${TOOL_ROFF_PS} ${SRCS} > ${.TARGET}
-
 .include <bsd.doc.mk>

Index: src/usr.bin/mail/Makefile
diff -u src/usr.bin/mail/Makefile:1.35 src/usr.bin/mail/Makefile:1.36
--- src/usr.bin/mail/Makefile:1.35	Tue Aug 16 11:49:17 2011
+++ src/usr.bin/mail/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.35 2011/08/16 11:49:17 christos Exp $
+#	$NetBSD: Makefile,v 1.36 2014/07/05 19:22:04 dholland Exp $
 #	@(#)Makefile	8.3 (Berkeley) 4/20/95
 
 .include <bsd.own.mk>
@@ -69,11 +69,9 @@ CWARNFLAGS+=	-Wextra
 .if ${MKSHARE} != "no"
 FILESDIR=		/usr/share/misc
 FILES=			mail.help mail.tildehelp
+.endif
 
-.if make(install)
 SUBDIR+= USD.doc
-.endif
-.endif
 
 CONFIGFILES=		mail.rc
 FILESDIR_mail.rc=	/etc

Index: src/usr.bin/mail/USD.doc/Makefile
diff -u src/usr.bin/mail/USD.doc/Makefile:1.5 src/usr.bin/mail/USD.doc/Makefile:1.6
--- src/usr.bin/mail/USD.doc/Makefile:1.5	Thu Jul 10 10:34:45 2003
+++ src/usr.bin/mail/USD.doc/Makefile	Sat Jul  5 19:22:04 2014
@@ -1,13 +1,12 @@
-#	$NetBSD: Makefile,v 1.5 2003/07/10 10:34:45 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:04 dholland Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	usd/07.mail
+SECTION=usd
+ARTICLE=mail
 SRCS=	mail0.nr mail1.nr mail2.nr mail3.nr mail4.nr mail5.nr mail6.nr \
 	mail7.nr mail8.nr mail9.nr maila.nr
 MACROS=	-me
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
+#EXTRAHTMLFILES=# none!
 
 .include <bsd.doc.mk>

Index: src/usr.bin/make/Makefile
diff -u src/usr.bin/make/Makefile:1.56 src/usr.bin/make/Makefile:1.57
--- src/usr.bin/make/Makefile:1.56	Wed May 30 21:54:23 2012
+++ src/usr.bin/make/Makefile	Sat Jul  5 19:22:05 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.56 2012/05/30 21:54:23 sjg Exp $
+#	$NetBSD: Makefile,v 1.57 2014/07/05 19:22:05 dholland Exp $
 #	@(#)Makefile	5.2 (Berkeley) 12/28/90
 
 PROG=	make
@@ -25,9 +25,7 @@ COPTS.meta.c += -DHAVE_FILEMON_H -I${FIL
 .endif
 
 .PATH:	${.CURDIR}/lst.lib
-.if make(install)
 SUBDIR=	PSD.doc
-.endif
 .if make(obj) || make(clean)
 SUBDIR+= unit-tests
 .endif

Index: src/usr.bin/make/PSD.doc/Makefile
diff -u src/usr.bin/make/PSD.doc/Makefile:1.2 src/usr.bin/make/PSD.doc/Makefile:1.3
--- src/usr.bin/make/PSD.doc/Makefile:1.2	Wed Jun 14 15:20:23 1995
+++ src/usr.bin/make/PSD.doc/Makefile	Sat Jul  5 19:22:05 2014
@@ -1,8 +1,10 @@
-#	$NetBSD: Makefile,v 1.2 1995/06/14 15:20:23 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2014/07/05 19:22:05 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 8/14/93
 
-DIR=	psd/12.make
+SECTION=psd
+ARTICLE=make
 SRCS=	tutorial.ms
 MACROS=	-ms
+EXTRAHTMLFILES=make1.png make2.png
 
 .include <bsd.doc.mk>

Index: src/usr.sbin/lpr/Makefile
diff -u src/usr.sbin/lpr/Makefile:1.10 src/usr.sbin/lpr/Makefile:1.11
--- src/usr.sbin/lpr/Makefile:1.10	Tue Jan  9 03:13:42 2001
+++ src/usr.sbin/lpr/Makefile	Sat Jul  5 19:22:05 2014
@@ -1,10 +1,7 @@
-#	$NetBSD: Makefile,v 1.10 2001/01/09 03:13:42 lukem Exp $
+#	$NetBSD: Makefile,v 1.11 2014/07/05 19:22:05 dholland Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 
 SUBDIR=	common_source .WAIT lp lpc lpd lpq lpr lprm lptest pac filters
-
-.if make(install)
 SUBDIR+= SMM.doc
-.endif
 
 .include <bsd.subdir.mk>

Index: src/usr.sbin/lpr/SMM.doc/Makefile
diff -u src/usr.sbin/lpr/SMM.doc/Makefile:1.5 src/usr.sbin/lpr/SMM.doc/Makefile:1.6
--- src/usr.sbin/lpr/SMM.doc/Makefile:1.5	Thu Jul 10 10:34:48 2003
+++ src/usr.sbin/lpr/SMM.doc/Makefile	Sat Jul  5 19:22:05 2014
@@ -1,12 +1,11 @@
-#	$NetBSD: Makefile,v 1.5 2003/07/10 10:34:48 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:05 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	smm/07.lpd
+SECTION=smm
+ARTICLE=lpd
 SRCS=	0.t 1.t 2.t 3.t 4.t 5.t 6.t 7.t
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
+EXTRAHTMLFILES=lpd1.png lpd2.png lpd3.png
 
 .include <bsd.doc.mk>

Index: src/usr.sbin/timed/Makefile
diff -u src/usr.sbin/timed/Makefile:1.4 src/usr.sbin/timed/Makefile:1.5
--- src/usr.sbin/timed/Makefile:1.4	Sun Dec 21 16:14:41 1997
+++ src/usr.sbin/timed/Makefile	Sat Jul  5 19:22:05 2014
@@ -1,10 +1,7 @@
-#	$NetBSD: Makefile,v 1.4 1997/12/21 16:14:41 christos Exp $
+#	$NetBSD: Makefile,v 1.5 2014/07/05 19:22:05 dholland Exp $
 #	@(#)Makefile	8.1 (Berkeley) 6/6/93
 
 SUBDIR=	timed timedc
-
-.if make(install)
 SUBDIR+= SMM.doc
-.endif
 
 .include <bsd.subdir.mk>

Index: src/usr.sbin/timed/SMM.doc/timed/Makefile
diff -u src/usr.sbin/timed/SMM.doc/timed/Makefile:1.5 src/usr.sbin/timed/SMM.doc/timed/Makefile:1.6
--- src/usr.sbin/timed/SMM.doc/timed/Makefile:1.5	Thu Jul 10 10:34:49 2003
+++ src/usr.sbin/timed/SMM.doc/timed/Makefile	Sat Jul  5 19:22:05 2014
@@ -1,13 +1,18 @@
-#	$NetBSD: Makefile,v 1.5 2003/07/10 10:34:49 lukem Exp $
+#	$NetBSD: Makefile,v 1.6 2014/07/05 19:22:05 dholland Exp $
 #
 #	@(#)Makefile	8.2 (Berkeley) 5/11/94
 
-DIR=	smm/12.timed
+SECTION=smm
+ARTICLE=timed
 SRCS=	timed.ms
+DEPSRCS=time date unused loop # spell.ok?
 MACROS=	-ms
-
-paper.ps: ${SRCS}
-	${TOOL_SOELIM} -I${.CURDIR} ${.ALLSRC} | ${TOOL_TBL} | \
-	    ${TOOL_ROFF_PS} ${MACROS} > ${.TARGET}
+ROFF_TBL=yes
+EXTRAHTMLFILES=\
+	timed1.png timed2.png timed3.png timed4.png timed5.png \
+	timed6.png timed7.png timed8.png timed9.png timed10.png \
+	timed11.png timed12.png timed13.png timed14.png timed15.png \
+	timed16.png timed17.png timed18.png timed19.png timed20.png \
+	timed21.png timed22.png timed23.png timed24.png
 
 .include <bsd.doc.mk>

Index: src/usr.sbin/timed/SMM.doc/timedop/Makefile
diff -u src/usr.sbin/timed/SMM.doc/timedop/Makefile:1.2 src/usr.sbin/timed/SMM.doc/timedop/Makefile:1.3
--- src/usr.sbin/timed/SMM.doc/timedop/Makefile:1.2	Fri Jan  9 08:11:58 1998
+++ src/usr.sbin/timed/SMM.doc/timedop/Makefile	Sat Jul  5 19:22:05 2014
@@ -1,9 +1,11 @@
-#	$NetBSD: Makefile,v 1.2 1998/01/09 08:11:58 perry Exp $
+#	$NetBSD: Makefile,v 1.3 2014/07/05 19:22:05 dholland Exp $
 #
 #	@(#)Makefile	8.1 (Berkeley) 6/8/93
 
-DIR=	smm/11.timedop
+SECTION=smm
+ARTICLE=timedop
 SRCS=	timed.ms
 MACROS=	-ms
+EXTRAHTMLFILES=timedop1.png timedop2.png
 
 .include <bsd.doc.mk>

Added files:

Index: src/bin/sh/USD.doc/referargs
diff -u /dev/null src/bin/sh/USD.doc/referargs:1.1
--- /dev/null	Sat Jul  5 19:22:05 2014
+++ src/bin/sh/USD.doc/referargs	Sat Jul  5 19:22:02 2014
@@ -0,0 +1,8 @@
+.\" $NetBSD: referargs,v 1.1 2014/07/05 19:22:02 dholland Exp $
+.\"
+.\" Arguments for refer; these were previously passed on the refer(1)
+.\" command line: -e -p Rv7man
+.R1
+accumulate
+database Rv7man
+.R2

Reply via email to