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