No empty .Rs/.Re
[netbsd-mini2440.git] / share / mk / bsd.doc.mk
blobb337b08cb39debef10427b2bc95be38780eff14b
1 # $NetBSD: bsd.doc.mk,v 1.63 2004/01/29 01:48:45 lukem Exp $
2 # @(#)bsd.doc.mk 8.1 (Berkeley) 8/14/93
4 .include <bsd.init.mk>
6 ##### Basic targets
7 clean: cleandoc
8 realinstall: docinstall
10 ##### Build rules
11 .if !target(paper.ps)
12 paper.ps: ${SRCS}
13 ${_MKTARGET_FORMAT}
14 ${TOOL_ROFF_PS} ${MACROS} ${PAGES} ${.ALLSRC} > ${.TARGET}
15 .endif
17 .if ${MKSHARE} != "no"
18 realall: paper.ps
19 .endif
21 ##### Install rules
22 docinstall:: # ensure existence
23 .PHONY: docinstall
25 .if ${MKDOC} != "no"
27 __docinstall: .USE
28 ${_MKTARGET_INSTALL}
29 ${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
30 ${.ALLSRC} ${.TARGET}
32 FILES?= ${SRCS}
34 .for F in Makefile ${FILES:O:u} ${EXTRA}
35 _F:= ${DESTDIR}${DOCDIR}/${DIR}/${F} # installed path
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
49 docinstall:: ${_F}
50 .PRECIOUS: ${_F} # keep if install fails
51 .endfor
53 .undef _F
54 .endif # ${MKDOC} != "no"
56 ##### Clean rules
57 cleandoc: .PHONY
58 rm -f paper.* [eE]rrs mklog ${CLEANFILES}
60 ##### Custom rules
61 .if !target(print)
62 print: .PHONY paper.ps
63 lpr -P${PRINTER} ${.ALLSRC}
64 .endif
66 spell: .PHONY ${SRCS}
67 spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
69 ##### Pull in related .mk logic
70 .include <bsd.obj.mk>
71 .include <bsd.sys.mk>
73 ${TARGETS}: # ensure existence