1285809Sscottl# $Id: doc.mk,v 1.5 2015/09/08 06:15:31 sjg Exp $
2285809Sscottl
3285809Sscottl.if !target(__${.PARSEFILE}__)
4285809Sscottl__${.PARSEFILE}__:
5285809Sscottl
6285809SscottlBIB?=		bib
7285809SscottlEQN?=		eqn
8285809SscottlGREMLIN?=	grn
9285809SscottlGRIND?=		vgrind -f
10285809SscottlINDXBIB?=	indxbib
11285809SscottlPIC?=		pic
12285809SscottlREFER?=		refer
13285809SscottlROFF?=		groff -M/usr/share/tmac ${MACROS} ${PAGES}
14285809SscottlSOELIM?=	soelim
15285809SscottlTBL?=		tbl
16285809Sscottl
17285809Sscottl.PATH: ${.CURDIR}
18285809Sscottl
19285809Sscottl.if !target(all)
20285809Sscottl.MAIN: all
21285809Sscottlall: paper.ps
22285809Sscottl.endif
23285809Sscottl
24285809Sscottl.if !target(paper.ps)
25285809Sscottlpaper.ps: ${SRCS}
26285809Sscottl	${ROFF} ${SRCS} > ${.TARGET}
27285809Sscottl.endif
28285809Sscottl
29285809Sscottl.if !target(print)
30285809Sscottlprint: paper.ps
31285809Sscottl	lpr -P${PRINTER} paper.ps
32285809Sscottl.endif
33285809Sscottl
34285809Sscottl.if !target(manpages)
35285809Sscottlmanpages:
36285809Sscottl.endif
37285809Sscottl
38285809Sscottl.if !target(obj)
39285809Sscottlobj:
40285809Sscottl.endif
41285809Sscottl
42285809Sscottlclean cleandir:
43285809Sscottl	rm -f paper.* [eE]rrs mklog ${CLEANFILES}
44285809Sscottl
45285809Sscottl.if ${MK_DOC} == "no"
46285809Sscottlinstall:
47285809Sscottl.else
48285809SscottlFILES?=	${SRCS}
49285809Sscottlinstall:
50285809Sscottl	test -d ${DESTDIR}${DOCDIR}/${DIR} || \
51285809Sscottl	    ${INSTALL} -d ${DOC_INSTALL_OWN} -m ${DIRMODE} ${DESTDIR}${DOCDIR}/${DIR}
52285809Sscottl	${INSTALL} ${COPY} ${DOC_INSTALL_OWN} -m ${DOCMODE} \
53285809Sscottl	    Makefile ${FILES} ${EXTRA} ${DESTDIR}${DOCDIR}/${DIR}
54285809Sscottl.endif
55285809Sscottl
56285809Sscottlspell: ${SRCS}
57285809Sscottl	spell ${SRCS} | sort | comm -23 - spell.ok > paper.spell
58285809Sscottl
59285809Sscottl.include <own.mk>
60285809Sscottl
61285809Sscottl.if !empty(DOCOWN)
62285809SscottlDOC_INSTALL_OWN?= -o ${DOCOWN} -g ${DOGGRP}
63285809Sscottl.endif
64285809Sscottl
65285809Sscottl.endif
66285809Sscottl