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