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