bsd.doc.mk revision 26760
1# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91 2# $Id: bsd.doc.mk,v 1.37 1997/05/11 10:42:00 wosch Exp $ 3# 4# The include file <bsd.doc.mk> handles installing BSD troff documents. 5# <bsd.prog.mk> includes the include files <bsd.dep.mk> and <bsd.obj.mk>. 6# 7# 8# +++ variables +++ 9# 10# LPR Printer command. [lpr] 11# 12# [incomplete] 13# 14# +++ targets +++ 15# 16# [incomplete] 17 18PRINTERDEVICE?= ascii 19 20BIB?= bib 21EQN?= eqn -T${PRINTERDEVICE} 22GREMLIN?= grn 23GRIND?= vgrind -f 24INDXBIB?= indxbib 25PIC?= pic 26REFER?= refer 27.if ${PRINTERDEVICE} == "ascii" 28ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES} 29.else 30ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES} 31.endif 32SOELIM?= soelim 33SOELIMPP= sed ${SOELIMPPARGS} 34SOELIMPPARGS0= ${SRCS} ${EXTRA} 35SOELIMPPARGS1= ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\ ][\\ \\ ]*\)\(/} 36SOELIMPPARGS2= ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/} 37SOELIMPPARGS= ${SOELIMPPARGS2:S/\\'/'/g} 38TBL?= tbl 39 40DOC?= paper 41LPR?= lpr 42 43TRFLAGS+= -T${PRINTERDEVICE} 44.if defined(USE_EQN) 45TRFLAGS+= -e 46.endif 47.if defined(USE_TBL) 48TRFLAGS+= -t 49.endif 50.if defined(USE_PIC) 51TRFLAGS+= -p 52.endif 53.if defined(USE_SOELIM) 54TRFLAGS+= -s 55.endif 56.if defined(USE_REFER) 57TRFLAGS+= -R 58.endif 59 60DCOMPRESS_EXT?= ${COMPRESS_EXT} 61.if defined(NODOCCOMPRESS) || ${PRINTERDEVICE} == "html" 62DFILE= ${DOC}.${PRINTERDEVICE} 63DCOMPRESS_CMD= cat 64.else 65DFILE= ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT} 66DCOMPRESS_CMD?= ${COMPRESS_CMD} 67.endif 68 69PAGES?= 1- 70 71UNROFF?= unroff 72HTML_SPLIT?= yes 73UNROFFFLAGS?= -fhtml 74.if ${HTML_SPLIT} == "yes" 75UNROFFFLAGS+= split=1 76.endif 77 78# Compatibility mode flag for groff. Use this when formatting documents with 79# Berkeley me macros. 80COMPAT?= -C 81 82.PATH: ${.CURDIR} ${SRCDIR} 83 84.MAIN: all 85all: ${DFILE} 86 87.if !target(print) 88print: ${DFILE} 89.if defined(NODOCCOMPRESS) 90 ${LPR} ${DFILE} 91.else 92 ${DCOMPRESS_CMD} -d ${DFILE} | ${LPR} 93.endif 94.endif 95 96CLEANFILES+= ${DOC}.${PRINTERDEVICE} \ 97 ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT} \ 98 ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \ 99 ${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \ 100 ${DOC}.html ${DOC}-*.html 101 102 103FILES?= ${SRCS} 104realinstall: 105.if ${PRINTERDEVICE} == "html" 106 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 107 ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME} 108.else 109 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ 110 ${DFILE} ${DESTDIR}${BINDIR}/${VOLUME} 111.endif 112 113install: beforeinstall realinstall afterinstall 114 115.if !target(beforeinstall) 116beforeinstall: 117 118.endif 119.if !target(afterinstall) 120afterinstall: 121 122.endif 123 124DISTRIBUTION?= doc 125.if !target(distribute) 126distribute: 127.for dist in ${DISTRIBUTION} 128 cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies 129.endfor 130.endif 131 132spell: ${SRCS} 133 (cd ${.CURDIR}; spell ${SRCS} ) | sort | \ 134 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell 135 136BINDIR?= /usr/share/doc 137BINMODE= 444 138 139SRCDIR?= ${.CURDIR} 140 141.if !target(${DFILE}) 142.if ${PRINTERDEVICE} == "html" 143${DFILE}: ${SRCS} ${EXTRA} ${OBJS} 144 cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \ 145 document=${.OBJDIR}/${DOC} ${SRCS} 146.else 147 148${DFILE}:: ${SRCS} ${EXTRA} ${OBJS} 149# XXX ${.ALLSRC} doesn't work unless there are a lot of .PATH.foo statements. 150ALLSRCS= ${SRCS:S;^;${SRCDIR}/;} 151${DFILE}:: ${SRCS} 152.if defined(USE_SOELIMPP) 153 ${SOELIMPP} ${ALLSRCS} | ${ROFF} | ${DCOMPRESS_CMD} > ${.TARGET} 154.else 155 (cd ${SRCDIR}; ${ROFF} ${.ALLSRC}) | ${DCOMPRESS_CMD} > ${.TARGET} 156.endif 157.else 158.if !defined(NODOCCOMPRESS) 159${DFILE}: ${DOC}.${PRINTERDEVICE} 160 ${DCOMPRESS_CMD} ${DOC}.${PRINTERDEVICE} > ${.TARGET} 161.endif 162.endif 163.endif 164 165.if !target(depend) 166depend: 167.endif 168 169.if !target(maninstall) 170maninstall: 171.endif 172 173.include <bsd.dep.mk> 174.include <bsd.obj.mk> 175