xref: /netbsd/share/mk/bsd.doc.mk (revision c4a72b64)
1#	$NetBSD: bsd.doc.mk,v 1.58 2002/10/22 18:48:27 perry Exp $
2#	@(#)bsd.doc.mk	8.1 (Berkeley) 8/14/93
3
4.include <bsd.init.mk>
5
6##### Basic targets
7.PHONY:		cleandoc docinstall print spell
8clean:		cleandoc
9realinstall:	docinstall
10
11##### Default values
12EQN?=		eqn
13GREMLIN?=	grn
14GRIND?=		vgrind -f
15INDXBIB?=	indxbib
16PIC?=		pic
17REFER?=		refer
18ROFF?=		${GROFF} -Tps
19SOELIM?=	soelim
20TBL?=		tbl
21
22##### Build rules
23.if !target(paper.ps)
24paper.ps: ${SRCS}
25	${ROFF} ${MACROS} ${PAGES} ${.ALLSRC} > ${.TARGET}
26.endif
27
28.if ${MKSHARE} != "no"
29realall:	paper.ps
30.endif
31
32##### Install rules
33docinstall::	# ensure existence
34.if ${MKDOC} != "no"
35
36__docinstall: .USE
37	${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} ${SYSPKGTAG} \
38		${.ALLSRC} ${.TARGET}
39
40FILES?=		${SRCS}
41
42.for F in Makefile ${FILES:O:u} ${EXTRA}
43_F:=		${DESTDIR}${DOCDIR}/${DIR}/${F}		# installed path
44
45.if !defined(UPDATE)
46${_F}!		${F} __docinstall			# install rule
47.if !defined(BUILD) && !make(all) && !make(${F})
48${_F}!		.MADE					# no build at install
49.endif
50.else
51${_F}:		${F} __docinstall			# install rule
52.if !defined(BUILD) && !make(all) && !make(${F})
53${_F}:		.MADE					# no build at install
54.endif
55.endif
56
57docinstall::	${_F}
58.PRECIOUS:	${_F}					# keep if install fails
59.endfor
60
61.undef _F
62.endif # ${MKDOC} != "no"
63
64##### Clean rules
65cleandoc:
66	rm -f paper.* [eE]rrs mklog ${CLEANFILES}
67
68##### Custom rules
69.if !target(print)
70print: paper.ps
71	lpr -P${PRINTER} ${.ALLSRC}
72.endif
73
74spell: ${SRCS}
75	spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
76
77##### Pull in related .mk logic
78.include <bsd.obj.mk>
79.include <bsd.sys.mk>
80
81${TARGETS}:	# ensure existence
82