1 # from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
4 # The include file <bsd.doc.mk> handles installing BSD troff documents.
9 # LPR Printer command. [lpr]
17 .if !target(__initialized__)
19 .if exists(${.CURDIR}/../Makefile.inc)
20 .include "${.CURDIR}/../Makefile.inc"
27 EQN?= eqn -T${PRINTERDEVICE}
33 .if ${PRINTERDEVICE} == "ascii"
34 ROFF?= groff -mtty-char ${TRFLAGS} ${MACROS} -o${PAGES}
36 ROFF?= groff ${TRFLAGS} ${MACROS} -o${PAGES}
39 SOELIMPP= sed ${SOELIMPPARGS}
40 SOELIMPPARGS0= ${SRCS} ${EXTRA}
41 SOELIMPPARGS1= ${SOELIMPPARGS0:S/^/-e\\ \'s:\(\.so[\\ \\ ][\\ \\ ]*\)\(/}
42 SOELIMPPARGS2= ${SOELIMPPARGS1:S/$/\)\$:\1${SRCDIR}\/\2:\'/}
43 SOELIMPPARGS= ${SOELIMPPARGS2:S/\\'/'/g}
49 TRFLAGS+= -T${PRINTERDEVICE}
59 .if defined(USE_SOELIM)
62 .if defined(USE_REFER)
66 DCOMPRESS_EXT?= ${COMPRESS_EXT}
67 .if defined(NODOCCOMPRESS) || ${PRINTERDEVICE} == "html"
68 DFILE= ${DOC}.${PRINTERDEVICE}
71 DFILE= ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
72 DCOMPRESS_CMD?= ${COMPRESS_CMD}
80 .if ${HTML_SPLIT} == "yes"
84 # Compatibility mode flag for groff. Use this when formatting documents with
88 .PATH: ${.CURDIR} ${SRCDIR}
95 .if defined(NODOCCOMPRESS)
98 ${DCOMPRESS_CMD} -d ${DFILE} | ${LPR}
102 .if ${PRINTERDEVICE} != "ascii" && ${PRINTERDEVICE} != "ps"
103 CLEANFILES+= ${DOC}.${PRINTERDEVICE} ${DOC}.${PRINTERDEVICE}${DCOMPRESS_EXT}
105 CLEANFILES+= ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
106 ${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \
107 ${DOC}.html ${DOC}-*.html
111 .if ${PRINTERDEVICE} == "html"
113 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
114 ${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}
116 ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
117 ${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
120 install: beforeinstall realinstall afterinstall
122 .if !target(beforeinstall)
126 .if !target(afterinstall)
132 .if !target(distribute)
134 .for dist in ${DISTRIBUTION}
135 cd ${.CURDIR} ; $(MAKE) install DESTDIR=${DISTDIR}/${dist} SHARED=copies
140 (cd ${.CURDIR}; spell ${SRCS} ) | sort | \
141 comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
143 BINDIR?= /usr/share/doc
148 .if !target(${DFILE})
149 _stamp.extraobjs: ${EXTRA} ${OBJS}
151 CLEANFILES+= _stamp.extraobjs
152 ${DFILE}: ${SRCS} _stamp.extraobjs
153 .if ${PRINTERDEVICE} == "html"
154 cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
155 document=${DOC} ${SRCS}
156 .elif defined(USE_SOELIMPP)
157 ${SOELIMPP} ${.ALLSRC:N_stamp.extraobjs} | ${ROFF} | \
158 ${DCOMPRESS_CMD} > ${.TARGET}
160 (cd ${SRCDIR}; ${ROFF} ${.ALLSRC:N_stamp.extraobjs}) | \
161 ${DCOMPRESS_CMD} > ${.TARGET}
169 .if !target(maninstall)
177 .include <bsd.obj.mk>