1 # from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
2 # $FreeBSD: src/share/mk/bsd.doc.mk,v 1.47.2.5 2002/08/07 16:31:50 ru Exp $
3 # $DragonFly: src/share/mk/bsd.doc.mk,v 1.2 2003/06/17 04:37:02 dillon Exp $
5 # The include file <bsd.doc.mk> handles installing BSD troff documents.
10 # LPR Printer command. [lpr]
18 .
include <bsd.init.mk
>
23 EQN?
= eqn
-T
${PRINTERDEVICE}
29 .if
${PRINTERDEVICE} == "ascii"
30 ROFF?
= groff
-mtty-char
${TRFLAGS} ${MACROS} -o
${PAGES}
32 ROFF?
= groff
${TRFLAGS} ${MACROS} -o
${PAGES}
35 SOELIMPP
= sed
${SOELIMPPARGS}
36 SOELIMPPARGS0
= ${SRCS} ${EXTRA}
37 SOELIMPPARGS1
= ${SOELIMPPARGS0
:S
/^
/-e
\\ \'s
:\
(\.so
[\\ \\ ][\\ \\ ]*\
)\
(/}
38 SOELIMPPARGS2
= ${SOELIMPPARGS1
:S
/$/\
)\
$:\
1${SRCDIR}\
/\
2:\'/}
39 SOELIMPPARGS
= ${SOELIMPPARGS2
:S
/\\'/'/g
}
45 TRFLAGS
+= -T
${PRINTERDEVICE}
55 .if defined
(USE_SOELIM
)
58 .if defined
(USE_REFER
)
62 DCOMPRESS_EXT?
= ${COMPRESS_EXT}
63 .if defined
(NODOCCOMPRESS
) ||
${PRINTERDEVICE} == "html"
64 DFILE
= ${DOC}.
${PRINTERDEVICE}
67 DFILE
= ${DOC}.
${PRINTERDEVICE}${DCOMPRESS_EXT}
68 DCOMPRESS_CMD?
= ${COMPRESS_CMD}
76 .if
${HTML_SPLIT} == "yes"
80 # Compatibility mode flag for groff. Use this when formatting documents with
84 .PATH
: ${.CURDIR
} ${SRCDIR}
90 .if defined
(NODOCCOMPRESS
)
93 ${DCOMPRESS_CMD} -d
${DFILE} |
${LPR}
97 .if
${PRINTERDEVICE} != "ascii" && ${PRINTERDEVICE} != "ps"
98 CLEANFILES
+= ${DOC}.
${PRINTERDEVICE} ${DOC}.
${PRINTERDEVICE}${DCOMPRESS_EXT}
100 CLEANFILES
+= ${DOC}.ascii
${DOC}.ascii
${DCOMPRESS_EXT} \
101 ${DOC}.ps
${DOC}.ps
${DCOMPRESS_EXT} \
102 ${DOC}.html
${DOC}-*.html
105 .if
${PRINTERDEVICE} == "html"
107 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
${BINMODE} \
108 ${DOC}*.html
${DESTDIR}${BINDIR}/${VOLUME}
110 ${INSTALL} -o
${BINOWN} -g
${BINGRP} -m
${BINMODE} \
111 ${DFILE} ${DESTDIR}${BINDIR}/${VOLUME}
115 (cd
${.CURDIR
}; spell
${SRCS} ) |
sort | \
116 comm
-23 - ${.CURDIR
}/spell.ok
> ${DOC}.spell
118 BINDIR?
= /usr
/share
/doc
123 .if
!target
(${DFILE})
124 _stamp.extraobjs
: ${EXTRA} ${OBJS}
126 CLEANFILES
+= _stamp.extraobjs
127 ${DFILE}: ${SRCS} _stamp.extraobjs
128 .if
${PRINTERDEVICE} == "html"
129 cd
${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
130 document
=${DOC} ${SRCS}
131 .elif defined
(USE_SOELIMPP
)
132 ${SOELIMPP} ${.ALLSRC
:N_stamp.extraobjs
} |
${ROFF} | \
133 ${DCOMPRESS_CMD} > ${.TARGET
}
135 (cd
${SRCDIR}; ${ROFF} ${.ALLSRC
:N_stamp.extraobjs
}) | \
136 ${DCOMPRESS_CMD} > ${.TARGET
}
142 .
include <bsd.obj.mk
>