Home | History | Annotate | Line # | Download | only in mk
bsd.doc.mk revision 1.57
      1 #	$NetBSD: bsd.doc.mk,v 1.57 2002/02/11 21:14:58 mycroft 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 ##### Default values
     12 EQN?=		eqn
     13 GREMLIN?=	grn
     14 GRIND?=		vgrind -f
     15 INDXBIB?=	indxbib
     16 PIC?=		pic
     17 REFER?=		refer
     18 ROFF?=		${GROFF} -Tps
     19 SOELIM?=	soelim
     20 TBL?=		tbl
     21 
     22 ##### Build rules
     23 .if !target(paper.ps)
     24 paper.ps: ${SRCS}
     25 	${ROFF} ${MACROS} ${PAGES} ${.ALLSRC} > ${.TARGET}
     26 .endif
     27 
     28 .if ${MKSHARE} != "no"
     29 realall:	paper.ps
     30 .endif
     31 
     32 ##### Install rules
     33 docinstall::	# ensure existence
     34 .if ${MKDOC} != "no"
     35 
     36 __docinstall: .USE
     37 	${INSTALL_FILE} -o ${DOCOWN} -g ${DOCGRP} -m ${DOCMODE} \
     38 		${.ALLSRC} ${.TARGET}
     39 
     40 FILES?=		${SRCS}
     41 
     42 .for F in Makefile ${FILES:O:u} ${EXTRA}
     43 _F:=		${DESTDIR}${DOCDIR}/${DIR}/${F}		# installed path
     44 
     45 .if !defined(UPDATE)
     46 ${_F}!		${F} __docinstall			# install rule
     47 .if !defined(BUILD) && !make(all) && !make(${F})
     48 ${_F}!		.MADE					# no build at install
     49 .endif
     50 .else
     51 ${_F}:		${F} __docinstall			# install rule
     52 .if !defined(BUILD) && !make(all) && !make(${F})
     53 ${_F}:		.MADE					# no build at install
     54 .endif
     55 .endif
     56 
     57 docinstall::	${_F}
     58 .PRECIOUS:	${_F}					# keep if install fails
     59 .endfor
     60 
     61 .undef _F
     62 .endif # ${MKDOC} != "no"
     63 
     64 ##### Clean rules
     65 cleandoc:
     66 	rm -f paper.* [eE]rrs mklog ${CLEANFILES}
     67 
     68 ##### Custom rules
     69 .if !target(print)
     70 print: paper.ps
     71 	lpr -P${PRINTER} ${.ALLSRC}
     72 .endif
     73 
     74 spell: ${SRCS}
     75 	spell ${.ALLSRC} | sort | comm -23 - spell.ok > paper.spell
     76 
     77 ##### Pull in related .mk logic
     78 .include <bsd.obj.mk>
     79 .include <bsd.sys.mk>
     80 
     81 ${TARGETS}:	# ensure existence
     82