1 # from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
2 # $Id: bsd.doc.mk,v 1.44 1998/05/06 18:44:00 bde Exp $
4 # The include file <bsd.doc.mk> handles installing BSD troff documents.
9 # LPR Printer command. [lpr]
17 .if exists(${.CURDIR}/../Makefile.inc)
18 .include "${.CURDIR}/../Makefile.inc"
24 EQN?= eqn -T${PRINTERDEVICE}
30 .if ${PRINTERDEVICE} == "ascii"
31 ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES}
33 ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES}
36 SOELIMPP= sed ${SOELIMPPARGS}
37 SOELIMPPARGS0= ${SRCS} ${EXTRA}
38 SOELIMPPARGS1= ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\ ][\\ \\ ]*\)\(/}
39 SOELIMPPARGS2= ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/}
40 SOELIMPPARGS= ${SOELIMPPARGS2:S/\\'/'/g}
46 TRFLAGS+= -T${PRINTERDEVICE}
56 .if defined(USE_SOELIM)
59 .if defined(USE_REFER)
63 DCOMPRESS_EXT?= ${COMPRESS_EXT}
64 .if defined(NODOCCOMPRESS) || ${PRINTERDEVICE} == "html"
65 DFILE= ${DOC}.${PRINTERDEVICE}
68 DFILE= ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
69 DCOMPRESS_CMD?= ${COMPRESS_CMD}
77 .if ${HTML_SPLIT} == "yes"
81 # Compatibility mode flag for groff. Use this when formatting documents with
85 .PATH: ${.CURDIR} ${SRCDIR}
92 .if defined(NODOCCOMPRESS)
95 ${DCOMPRESS_CMD} -d ${DFILE} | ${LPR}
99 .if ${PRINTERDEVICE} != "ascii" && ${PRINTERDEVICE} != "ps"
100 CLEANFILES+= ${DOC}.${PRINTERDEVICE} ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
102 CLEANFILES+= ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
103 ${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \
104 ${DOC}.html ${DOC}-*.html
108 .if ${PRINTERDEVICE} == "html"
110 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
111 ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
113 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
114 ${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
117 install: beforeinstall realinstall afterinstall
119 .if !target(beforeinstall)
123 .if !target(afterinstall)
129 .if !target(distribute)
131 .for dist in ${DISTRIBUTION}
132 cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
137 (cd ${.CURDIR}; spell ${SRCS} ) | sort | \
138 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
140 BINDIR?= /usr/share/doc
145 .if !target(${DFILE})
146 _stamp.extraobjs: ${EXTRA} ${OBJS}
148 CLEANFILES+= _stamp.extraobjs
149 ${DFILE}: ${SRCS} _stamp.extraobjs
150 .if ${PRINTERDEVICE} == "html"
151 cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
152 document=${DOC} ${SRCS}
153 .elif defined(USE_SOELIMPP)
154 ${SOELIMPP} ${.ALLSRC:N_stamp.extraobjs} | ${ROFF} | \
155 ${DCOMPRESS_CMD} > ${.TARGET}
157 (cd ${SRCDIR}; ${ROFF} ${.ALLSRC:N_stamp.extraobjs}) | \
158 ${DCOMPRESS_CMD} > ${.TARGET}
162 .if !target(maninstall)
170 .include <bsd.obj.mk>