1994-08-04 21:09:27 +00:00
|
|
|
# from: @(#)bsd.doc.mk 5.3 (Berkeley) 1/2/91
|
1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
1997-05-11 10:42:00 +00:00
|
|
|
#
|
|
|
|
# The include file <bsd.doc.mk> handles installing BSD troff documents.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# +++ variables +++
|
|
|
|
#
|
2002-10-30 17:03:48 +00:00
|
|
|
# DCOMPRESS_CMD Program to compress troff documents. Output is to stdout.
|
|
|
|
# [${COMPRESS_CMD}]
|
1997-05-11 10:42:00 +00:00
|
|
|
#
|
2002-10-30 17:03:48 +00:00
|
|
|
# DESTDIR Change the tree where the documents get installed. [not set]
|
1997-05-11 10:42:00 +00:00
|
|
|
#
|
2002-10-30 17:03:48 +00:00
|
|
|
# DOC Document name. [paper]
|
1997-05-11 10:42:00 +00:00
|
|
|
#
|
2002-10-30 17:03:48 +00:00
|
|
|
# EXTRA Extra files (not SRCS) that make up the document. [not set]
|
|
|
|
#
|
|
|
|
# LPR Printer command. [lpr]
|
|
|
|
#
|
|
|
|
# MACROS Macro packages used to build the document. [not set]
|
|
|
|
#
|
2014-05-10 16:38:54 +00:00
|
|
|
# WITHOUT_DOCCOMPRESS If you do not want formatted troff documents to be
|
2002-10-30 17:03:48 +00:00
|
|
|
# compressed when they are installed. [not set]
|
|
|
|
#
|
|
|
|
# PRINTERDEVICE Indicates which output formats will be generated
|
|
|
|
# (ascii, ps, html). [ascii]
|
|
|
|
#
|
|
|
|
# SRCDIR Directory where source files live. [${.CURDIR}]
|
|
|
|
#
|
|
|
|
# SRCS List of source files. [not set]
|
|
|
|
#
|
|
|
|
# TRFLAGS Additional flags to groff(1). [not set]
|
|
|
|
#
|
|
|
|
# USE_EQN If set, preprocess with eqn(1). [not set]
|
|
|
|
#
|
|
|
|
# USE_PIC If set, preprocess with pic(1). [not set]
|
|
|
|
#
|
|
|
|
# USE_REFER If set, preprocess with refer(1). [not set]
|
|
|
|
#
|
|
|
|
# USE_SOELIM If set, preprocess with soelim(1). [not set]
|
|
|
|
#
|
|
|
|
# USE_TBL If set, preprocess with tbl(1). [not set]
|
|
|
|
#
|
|
|
|
# VOLUME Volume the document belongs to. [not set]
|
1994-08-04 21:09:27 +00:00
|
|
|
|
2002-04-17 13:49:29 +00:00
|
|
|
.include <bsd.init.mk>
|
1997-11-02 18:50:53 +00:00
|
|
|
|
1996-12-19 22:40:43 +00:00
|
|
|
PRINTERDEVICE?= ascii
|
1994-05-30 19:09:18 +00:00
|
|
|
|
|
|
|
BIB?= bib
|
|
|
|
GREMLIN?= grn
|
|
|
|
GRIND?= vgrind -f
|
|
|
|
INDXBIB?= indxbib
|
|
|
|
PIC?= pic
|
|
|
|
REFER?= refer
|
2002-10-29 16:13:21 +00:00
|
|
|
.for _dev in ${PRINTERDEVICE:Mascii}
|
2011-06-03 11:58:17 +00:00
|
|
|
ROFF.ascii?= groff -Tascii -P-c ${TRFLAGS} -mtty-char ${MACROS} ${PAGES:C/^/-o/1}
|
2002-10-29 16:13:21 +00:00
|
|
|
.endfor
|
|
|
|
.for _dev in ${PRINTERDEVICE:Nascii}
|
2011-06-03 11:58:17 +00:00
|
|
|
ROFF.${_dev}?= groff -T${_dev} ${TRFLAGS} ${MACROS} ${PAGES:C/^/-o/1}
|
2002-10-29 16:13:21 +00:00
|
|
|
.endfor
|
1994-05-30 19:09:18 +00:00
|
|
|
SOELIM?= soelim
|
|
|
|
TBL?= tbl
|
|
|
|
|
1995-01-11 00:00:11 +00:00
|
|
|
DOC?= paper
|
1997-05-11 10:42:00 +00:00
|
|
|
LPR?= lpr
|
1995-01-11 00:00:11 +00:00
|
|
|
|
|
|
|
.if defined(USE_EQN)
|
|
|
|
TRFLAGS+= -e
|
|
|
|
.endif
|
|
|
|
.if defined(USE_PIC)
|
|
|
|
TRFLAGS+= -p
|
|
|
|
.endif
|
|
|
|
.if defined(USE_REFER)
|
1997-04-04 01:25:32 +00:00
|
|
|
TRFLAGS+= -R
|
1995-01-11 00:00:11 +00:00
|
|
|
.endif
|
2002-10-29 14:56:09 +00:00
|
|
|
.if defined(USE_SOELIM)
|
2015-06-20 00:17:57 +00:00
|
|
|
TRFLAGS+= -I${.CURDIR}
|
2002-10-29 14:56:09 +00:00
|
|
|
.endif
|
|
|
|
.if defined(USE_TBL)
|
|
|
|
TRFLAGS+= -t
|
|
|
|
.endif
|
1995-01-11 00:00:11 +00:00
|
|
|
|
1997-03-08 23:46:56 +00:00
|
|
|
DCOMPRESS_EXT?= ${COMPRESS_EXT}
|
|
|
|
DCOMPRESS_CMD?= ${COMPRESS_CMD}
|
2002-10-29 16:13:21 +00:00
|
|
|
.for _dev in ${PRINTERDEVICE:Mhtml}
|
|
|
|
DFILE.html= ${DOC}.html
|
|
|
|
.endfor
|
|
|
|
.for _dev in ${PRINTERDEVICE:Nhtml}
|
2014-05-10 16:38:54 +00:00
|
|
|
.if ${MK_DOCCOMPRESS} == "no"
|
2002-10-29 16:13:21 +00:00
|
|
|
DFILE.${_dev}= ${DOC}.${_dev}
|
|
|
|
.else
|
|
|
|
DFILE.${_dev}= ${DOC}.${_dev}${DCOMPRESS_EXT}
|
1995-07-26 13:51:46 +00:00
|
|
|
.endif
|
2002-10-29 16:13:21 +00:00
|
|
|
.endfor
|
1995-07-26 13:51:46 +00:00
|
|
|
|
1997-02-13 03:26:02 +00:00
|
|
|
UNROFF?= unroff
|
|
|
|
HTML_SPLIT?= yes
|
1997-02-16 22:23:44 +00:00
|
|
|
UNROFFFLAGS?= -fhtml
|
1997-02-13 03:26:02 +00:00
|
|
|
.if ${HTML_SPLIT} == "yes"
|
|
|
|
UNROFFFLAGS+= split=1
|
|
|
|
.endif
|
|
|
|
|
1994-08-04 21:09:27 +00:00
|
|
|
# Compatibility mode flag for groff. Use this when formatting documents with
|
2002-10-29 14:56:09 +00:00
|
|
|
# Berkeley me macros (orig_me(7)).
|
1994-08-04 21:09:27 +00:00
|
|
|
COMPAT?= -C
|
1994-05-30 19:09:18 +00:00
|
|
|
|
1995-01-11 00:00:11 +00:00
|
|
|
.PATH: ${.CURDIR} ${SRCDIR}
|
1994-05-30 19:09:18 +00:00
|
|
|
|
2002-10-29 16:13:21 +00:00
|
|
|
.for _dev in ${PRINTERDEVICE}
|
|
|
|
all: ${DFILE.${_dev}}
|
|
|
|
.endfor
|
1994-05-30 19:09:18 +00:00
|
|
|
|
1994-08-04 21:09:27 +00:00
|
|
|
.if !target(print)
|
2002-10-29 16:13:21 +00:00
|
|
|
.for _dev in ${PRINTERDEVICE}
|
|
|
|
print: ${DFILE.${_dev}}
|
|
|
|
.endfor
|
|
|
|
print:
|
|
|
|
.for _dev in ${PRINTERDEVICE}
|
2014-05-10 16:38:54 +00:00
|
|
|
.if ${MK_DOCCOMPRESS} == "no"
|
2002-10-29 16:13:21 +00:00
|
|
|
${LPR} ${DFILE.${_dev}}
|
1995-07-26 13:51:46 +00:00
|
|
|
.else
|
2002-10-29 16:13:21 +00:00
|
|
|
${DCOMPRESS_CMD} -d ${DFILE.${_dev}} | ${LPR}
|
1995-07-26 13:51:46 +00:00
|
|
|
.endif
|
2002-10-29 16:13:21 +00:00
|
|
|
.endfor
|
1994-05-30 19:09:18 +00:00
|
|
|
.endif
|
|
|
|
|
2002-10-29 16:13:21 +00:00
|
|
|
.for _dev in ${PRINTERDEVICE:Nascii:Nps:Nhtml}
|
|
|
|
CLEANFILES+= ${DOC}.${_dev} ${DOC}.${_dev}${DCOMPRESS_EXT}
|
|
|
|
.endfor
|
1998-02-25 01:35:16 +00:00
|
|
|
CLEANFILES+= ${DOC}.ascii ${DOC}.ascii${DCOMPRESS_EXT} \
|
1997-03-08 23:46:56 +00:00
|
|
|
${DOC}.ps ${DOC}.ps${DCOMPRESS_EXT} \
|
1997-02-13 03:26:02 +00:00
|
|
|
${DOC}.html ${DOC}-*.html
|
|
|
|
|
1995-01-11 02:27:01 +00:00
|
|
|
realinstall:
|
2015-10-15 18:55:43 +00:00
|
|
|
.if ${PRINTERDEVICE:Mhtml}
|
1997-11-01 19:45:02 +00:00
|
|
|
cd ${SRCDIR}; \
|
2002-10-29 14:56:09 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
2015-11-13 17:27:23 +00:00
|
|
|
${DOC}*.html ${DESTDIR}${BINDIR}/${VOLUME}/
|
2015-10-15 18:55:43 +00:00
|
|
|
.endif
|
2002-10-29 16:13:21 +00:00
|
|
|
.for _dev in ${PRINTERDEVICE:Nhtml}
|
2002-07-29 09:40:17 +00:00
|
|
|
${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
|
2015-11-13 17:27:23 +00:00
|
|
|
${DFILE.${_dev}} ${DESTDIR}${BINDIR}/${VOLUME}/
|
2002-10-29 16:13:21 +00:00
|
|
|
.endfor
|
1994-05-30 19:09:18 +00:00
|
|
|
|
|
|
|
spell: ${SRCS}
|
2002-10-29 14:56:09 +00:00
|
|
|
(cd ${.CURDIR}; spell ${SRCS} ) | sort | \
|
1994-08-04 21:09:27 +00:00
|
|
|
comm -23 - ${.CURDIR}/spell.ok > ${DOC}.spell
|
1994-05-30 19:09:18 +00:00
|
|
|
|
|
|
|
BINDIR?= /usr/share/doc
|
2002-10-29 14:56:09 +00:00
|
|
|
BINMODE= 444
|
1995-01-11 00:00:11 +00:00
|
|
|
|
|
|
|
SRCDIR?= ${.CURDIR}
|
|
|
|
|
2002-10-29 14:56:09 +00:00
|
|
|
.if defined(EXTRA) && !empty(EXTRA)
|
|
|
|
_stamp.extra: ${EXTRA}
|
1998-08-02 13:50:23 +00:00
|
|
|
touch ${.TARGET}
|
2002-10-29 16:13:21 +00:00
|
|
|
.endif
|
|
|
|
|
2002-10-29 14:56:09 +00:00
|
|
|
CLEANFILES+= _stamp.extra
|
2002-10-29 16:13:21 +00:00
|
|
|
.for _dev in ${PRINTERDEVICE:Nhtml}
|
|
|
|
.if !target(${DFILE.${_dev}})
|
|
|
|
.if target(_stamp.extra)
|
|
|
|
${DFILE.${_dev}}: _stamp.extra
|
2002-10-29 14:56:09 +00:00
|
|
|
.endif
|
2002-10-29 16:13:21 +00:00
|
|
|
${DFILE.${_dev}}: ${SRCS}
|
2014-05-10 16:38:54 +00:00
|
|
|
.if ${MK_DOCCOMPRESS} == "no"
|
2002-10-29 16:13:21 +00:00
|
|
|
${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} > ${.TARGET}
|
2002-10-29 14:56:09 +00:00
|
|
|
.else
|
2002-10-29 16:13:21 +00:00
|
|
|
${ROFF.${_dev}} ${.ALLSRC:N_stamp.extra} | ${DCOMPRESS_CMD} > ${.TARGET}
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
.for _dev in ${PRINTERDEVICE:Mhtml}
|
|
|
|
.if !target(${DFILE.html})
|
|
|
|
.if target(_stamp.extra)
|
|
|
|
${DFILE.html}: _stamp.extra
|
2002-10-29 14:56:09 +00:00
|
|
|
.endif
|
2002-10-29 16:13:21 +00:00
|
|
|
${DFILE.html}: ${SRCS}
|
|
|
|
.if defined(MACROS) && !empty(MACROS)
|
|
|
|
cd ${SRCDIR}; ${UNROFF} ${MACROS} ${UNROFFFLAGS} \
|
|
|
|
document=${DOC} ${SRCS}
|
|
|
|
.else # unroff(1) requires a macro package as an argument
|
|
|
|
cd ${SRCDIR}; ${UNROFF} -ms ${UNROFFFLAGS} \
|
|
|
|
document=${DOC} ${SRCS}
|
1995-01-11 00:00:11 +00:00
|
|
|
.endif
|
1997-02-13 03:26:02 +00:00
|
|
|
.endif
|
2002-10-29 16:13:21 +00:00
|
|
|
.endfor
|
1995-01-11 00:00:11 +00:00
|
|
|
|
2002-04-24 13:29:34 +00:00
|
|
|
DISTRIBUTION?= doc
|
|
|
|
|
1996-06-24 04:26:21 +00:00
|
|
|
.include <bsd.obj.mk>
|