Home | History | Annotate | Line # | Download | only in mk
bsd.doc.mk revision 1.63
      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
      3 
      4 .include <bsd.init.mk>
      5 
      6 ##### Basic targets
      7 clean:		cleandoc
      8 realinstall:	docinstall
      9 
     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
     16 
     17 .if ${MKSHARE} != "no"
     18 realall:	paper.ps
     19 .endif
     20 
     21 ##### Install rules
     22 docinstall::	# 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} ${SYSPKGTAG} \
     30 		${.ALLSRC} ${.TARGET}
     31 
     32 FILES?=		${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 
     49 docinstall::	${_F}
     50 .PRECIOUS:	${_F}					# keep if install fails
     51 .endfor
     52 
     53 .undef _F
     54 .endif # ${MKDOC} != "no"
     55 
     56 ##### Clean rules
     57 cleandoc: .PHONY
     58 	rm -f paper.* [eE]rrs mklog ${CLEANFILES}
     59 
     60 ##### Custom rules
     61 .if !target(print)
     62 print: .PHONY paper.ps
     63 	lpr -P${PRINTER} ${.ALLSRC}
     64 .endif
     65 
     66 spell: .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