Skip to content

Commit

Permalink
Rework /usr/share/doc.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sauclovian committed Jul 5, 2014
1 parent 7e6e77d commit 6a97ad6
Show file tree
Hide file tree
Showing 47 changed files with 450 additions and 311 deletions.
12 changes: 6 additions & 6 deletions bin/csh/USD.doc/Makefile
Original file line number Diff line number Diff line change
@@ -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>
16 changes: 8 additions & 8 deletions bin/sh/USD.doc/Makefile
Original file line number Diff line number Diff line change
@@ -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>
8 changes: 8 additions & 0 deletions bin/sh/USD.doc/referargs
Original file line number Diff line number Diff line change
@@ -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
15 changes: 7 additions & 8 deletions external/bsd/nvi/docs/USD.doc/edit/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,5 +21,3 @@ paper.ps: ${SRCS}

editvindex:
${TOOL_ROFF_RAW} ${MACROS} -n22 edit.vindex

.include <bsd.doc.mk>
26 changes: 14 additions & 12 deletions external/bsd/nvi/docs/USD.doc/exref/Makefile
Original file line number Diff line number Diff line change
@@ -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>
28 changes: 9 additions & 19 deletions external/bsd/nvi/docs/USD.doc/vi.ref/Makefile
Original file line number Diff line number Diff line change
@@ -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/\\-/' \
Expand All @@ -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>
35 changes: 17 additions & 18 deletions external/bsd/nvi/docs/USD.doc/vitut/Makefile
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 1 addition & 3 deletions games/rogue/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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>
9 changes: 4 additions & 5 deletions games/rogue/USD.doc/Makefile
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 1 addition & 3 deletions games/trek/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,9 +15,7 @@ DPADD= ${LIBM}
LDADD= -lm
HIDEGAME=hidegame

.if make(install)
SUBDIR+=USD.doc
.endif

COPTS.getpar.c += -Wno-format-nonliteral

Expand Down
9 changes: 4 additions & 5 deletions games/trek/USD.doc/Makefile
Original file line number Diff line number Diff line change
@@ -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>
22 changes: 8 additions & 14 deletions lib/libcurses/PSD.doc/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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}
Expand Down
4 changes: 1 addition & 3 deletions sbin/fsck_ffs/Makefile
Original file line number Diff line number Diff line change
@@ -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>
Expand Down Expand Up @@ -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>
6 changes: 4 additions & 2 deletions sbin/fsck_ffs/SMM.doc/Makefile
Original file line number Diff line number Diff line change
@@ -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>
4 changes: 1 addition & 3 deletions share/doc/Makefile
Original file line number Diff line number Diff line change
@@ -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>
21 changes: 14 additions & 7 deletions share/doc/psd/05.sysman/Makefile
Original file line number Diff line number Diff line change
@@ -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} |\
Expand All @@ -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>
Loading

0 comments on commit 6a97ad6

Please sign in to comment.