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