1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
1996-05-25 23:09:49 +00:00
|
|
|
#
|
2005-01-06 11:12:43 +00:00
|
|
|
# The include file <bsd.man.mk> handles installing manual pages and
|
1997-11-09 15:03:15 +00:00
|
|
|
# their links.
|
1996-05-25 23:09:49 +00:00
|
|
|
#
|
|
|
|
#
|
|
|
|
# +++ variables +++
|
|
|
|
#
|
|
|
|
# DESTDIR Change the tree where the man pages gets installed. [not set]
|
|
|
|
#
|
|
|
|
# MANDIR Base path for manual installation. [${SHAREDIR}/man/man]
|
|
|
|
#
|
|
|
|
# MANOWN Manual owner. [${SHAREOWN}]
|
|
|
|
#
|
|
|
|
# MANGRP Manual group. [${SHAREGRP}]
|
|
|
|
#
|
|
|
|
# MANMODE Manual mode. [${NOBINMODE}]
|
|
|
|
#
|
|
|
|
# MANSUBDIR Subdirectory under the manual page section, i.e. "/i386"
|
|
|
|
# or "/tahoe" for machine specific manual pages.
|
|
|
|
#
|
2001-03-26 08:04:11 +00:00
|
|
|
# MAN The manual pages to be installed. For sections see
|
1996-05-25 23:09:49 +00:00
|
|
|
# variable ${SECTIONS}
|
|
|
|
#
|
1997-03-08 23:46:56 +00:00
|
|
|
# MCOMPRESS_CMD Program to compress man pages. Output is to
|
|
|
|
# stdout. [${COMPRESS_CMD}]
|
1996-05-25 23:09:49 +00:00
|
|
|
#
|
|
|
|
# MLINKS List of manual page links (using a suffix). The
|
2005-01-06 11:12:43 +00:00
|
|
|
# linked-to file must come first, the linked file
|
|
|
|
# second, and there may be multiple pairs. The files
|
1996-05-25 23:09:49 +00:00
|
|
|
# are hard-linked.
|
|
|
|
#
|
2004-12-21 09:44:43 +00:00
|
|
|
# NO_MLINKS If you do not want install manual page links. [not set]
|
1996-12-26 22:37:30 +00:00
|
|
|
#
|
2000-05-21 03:14:38 +00:00
|
|
|
# MANFILTER command to pipe the raw man page through before compressing
|
1996-08-11 12:31:57 +00:00
|
|
|
# or installing. Can be used to do sed substitution.
|
1996-05-25 23:09:49 +00:00
|
|
|
#
|
1997-07-24 18:39:46 +00:00
|
|
|
# MANBUILDCAT create preformatted manual pages in addition to normal
|
|
|
|
# pages. [not set]
|
|
|
|
#
|
|
|
|
# MROFF_CMD command and flags to create preformatted pages
|
|
|
|
#
|
1996-05-25 23:09:49 +00:00
|
|
|
# +++ targets +++
|
|
|
|
#
|
|
|
|
# maninstall:
|
|
|
|
# Install the manual pages and their links.
|
|
|
|
#
|
|
|
|
|
2002-04-17 13:49:29 +00:00
|
|
|
.if !target(__<bsd.init.mk>__)
|
|
|
|
.error bsd.man.mk cannot be included directly.
|
|
|
|
.endif
|
|
|
|
|
2002-08-20 11:11:37 +00:00
|
|
|
MINSTALL?= ${INSTALL} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
|
1994-05-30 19:09:18 +00:00
|
|
|
|
1997-07-24 18:39:46 +00:00
|
|
|
CATDIR= ${MANDIR:H:S/$/\/cat/}
|
|
|
|
CATEXT= .cat
|
2002-10-18 09:14:17 +00:00
|
|
|
MROFF_CMD?= groff -Tascii -mtty-char -man -t
|
2015-01-02 13:54:03 +00:00
|
|
|
MANDOC_CMD?= mandoc
|
1997-07-24 18:39:46 +00:00
|
|
|
|
1997-03-08 23:46:56 +00:00
|
|
|
MCOMPRESS_CMD?= ${COMPRESS_CMD}
|
|
|
|
MCOMPRESS_EXT?= ${COMPRESS_EXT}
|
1994-08-04 21:09:27 +00:00
|
|
|
|
2013-01-16 23:21:04 +00:00
|
|
|
SECTIONS= 1 2 3 4 5 6 7 8 9
|
2001-03-28 14:58:08 +00:00
|
|
|
.SUFFIXES: ${SECTIONS:S/^/./g}
|
2001-03-26 08:04:11 +00:00
|
|
|
|
|
|
|
# Backwards compatibility.
|
2001-03-28 14:58:08 +00:00
|
|
|
.if !defined(MAN)
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${__sect}) && !empty(MAN${__sect})
|
|
|
|
MAN+= ${MAN${__sect}}
|
1995-10-21 18:18:46 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
2001-03-28 14:58:08 +00:00
|
|
|
.endif
|
1995-10-21 18:18:46 +00:00
|
|
|
|
2002-05-07 15:42:56 +00:00
|
|
|
_manpages:
|
|
|
|
all-man: _manpages
|
1995-10-02 20:02:05 +00:00
|
|
|
|
2014-04-18 17:03:49 +00:00
|
|
|
.if ${MK_MANCOMPRESS} == "no"
|
1995-10-02 20:02:05 +00:00
|
|
|
|
1996-09-16 14:13:40 +00:00
|
|
|
# Make special arrangements to filter to a temporary file at build time
|
2014-04-18 17:03:49 +00:00
|
|
|
# for MK_MANCOMPRESS == no.
|
1996-09-16 14:13:40 +00:00
|
|
|
.if defined(MANFILTER)
|
|
|
|
FILTEXTENSION= .filt
|
|
|
|
.else
|
|
|
|
FILTEXTENSION=
|
|
|
|
.endif
|
|
|
|
|
1995-10-14 08:16:04 +00:00
|
|
|
ZEXT=
|
|
|
|
|
1996-08-11 12:31:57 +00:00
|
|
|
.if defined(MANFILTER)
|
2001-03-26 08:04:11 +00:00
|
|
|
.if defined(MAN) && !empty(MAN)
|
|
|
|
CLEANFILES+= ${MAN:T:S/$/${FILTEXTENSION}/g}
|
|
|
|
CLEANFILES+= ${MAN:T:S/$/${CATEXT}${FILTEXTENSION}/g}
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __page in ${MAN}
|
|
|
|
.for __target in ${__page:T:S/$/${FILTEXTENSION}/g}
|
|
|
|
_manpages: ${__target}
|
|
|
|
${__target}: ${__page}
|
1996-08-26 10:55:32 +00:00
|
|
|
${MANFILTER} < ${.ALLSRC} > ${.TARGET}
|
1996-08-11 12:31:57 +00:00
|
|
|
.endfor
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __target in ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g}
|
|
|
|
_manpages: ${__target}
|
|
|
|
${__target}: ${__page}
|
1997-07-24 18:39:46 +00:00
|
|
|
${MANFILTER} < ${.ALLSRC} | ${MROFF_CMD} > ${.TARGET}
|
1996-08-11 12:31:57 +00:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endif
|
1997-07-24 18:39:46 +00:00
|
|
|
.else
|
2001-03-26 08:04:11 +00:00
|
|
|
.if defined(MAN) && !empty(MAN)
|
|
|
|
CLEANFILES+= ${MAN:T:S/$/${CATEXT}/g}
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __page in ${MAN}
|
|
|
|
.for __target in ${__page:T:S/$/${CATEXT}/g}
|
|
|
|
_manpages: ${__target}
|
|
|
|
${__target}: ${__page}
|
1997-07-24 18:39:46 +00:00
|
|
|
${MROFF_CMD} ${.ALLSRC} > ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
.endfor
|
2002-05-13 13:04:46 +00:00
|
|
|
.else
|
|
|
|
_manpages: ${MAN}
|
1997-07-24 18:39:46 +00:00
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endif
|
1996-08-11 12:31:57 +00:00
|
|
|
|
1995-10-14 08:16:04 +00:00
|
|
|
.else
|
|
|
|
|
1997-03-08 23:46:56 +00:00
|
|
|
ZEXT= ${MCOMPRESS_EXT}
|
1995-10-14 08:16:04 +00:00
|
|
|
|
2001-03-26 08:04:11 +00:00
|
|
|
.if defined(MAN) && !empty(MAN)
|
|
|
|
CLEANFILES+= ${MAN:T:S/$/${MCOMPRESS_EXT}/g}
|
|
|
|
CLEANFILES+= ${MAN:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g}
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __page in ${MAN}
|
|
|
|
.for __target in ${__page:T:S/$/${MCOMPRESS_EXT}/}
|
|
|
|
_manpages: ${__target}
|
|
|
|
${__target}: ${__page}
|
1996-08-26 10:55:32 +00:00
|
|
|
.if defined(MANFILTER)
|
1997-03-08 23:46:56 +00:00
|
|
|
${MANFILTER} < ${.ALLSRC} | ${MCOMPRESS_CMD} > ${.TARGET}
|
1996-08-11 12:31:57 +00:00
|
|
|
.else
|
1997-03-08 23:46:56 +00:00
|
|
|
${MCOMPRESS_CMD} ${.ALLSRC} > ${.TARGET}
|
1996-08-11 12:31:57 +00:00
|
|
|
.endif
|
1995-10-02 20:02:05 +00:00
|
|
|
.endfor
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __target in ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/}
|
|
|
|
_manpages: ${__target}
|
|
|
|
${__target}: ${__page}
|
1997-07-24 18:39:46 +00:00
|
|
|
.if defined(MANFILTER)
|
|
|
|
${MANFILTER} < ${.ALLSRC} | ${MROFF_CMD} | ${MCOMPRESS_CMD} > ${.TARGET}
|
|
|
|
.else
|
|
|
|
${MROFF_CMD} ${.ALLSRC} | ${MCOMPRESS_CMD} > ${.TARGET}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endif
|
1995-10-02 20:02:05 +00:00
|
|
|
.endfor
|
1995-10-14 08:16:04 +00:00
|
|
|
.endif
|
1995-10-02 20:02:05 +00:00
|
|
|
|
1994-08-04 21:09:27 +00:00
|
|
|
.endif
|
|
|
|
|
2002-05-07 15:42:56 +00:00
|
|
|
maninstall: _maninstall
|
|
|
|
_maninstall:
|
2001-03-26 08:04:11 +00:00
|
|
|
.if defined(MAN) && !empty(MAN)
|
2002-05-07 15:42:56 +00:00
|
|
|
_maninstall: ${MAN}
|
2014-04-18 17:03:49 +00:00
|
|
|
.if ${MK_MANCOMPRESS} == "no"
|
1996-09-16 14:13:40 +00:00
|
|
|
.if defined(MANFILTER)
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __page in ${MAN}
|
|
|
|
${MINSTALL} ${__page:T:S/$/${FILTEXTENSION}/g} \
|
|
|
|
${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}/${__page}
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
2007-03-12 13:54:52 +00:00
|
|
|
${MINSTALL} ${__page:T:S/$/${CATEXT}${FILTEXTENSION}/g} \
|
|
|
|
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page}
|
1997-07-24 18:39:46 +00:00
|
|
|
.endif
|
1996-09-16 14:13:40 +00:00
|
|
|
.endfor
|
|
|
|
.else
|
2003-09-07 12:59:22 +00:00
|
|
|
@set ${.ALLSRC:C/\.([^.]*)$/.\1 \1/}; \
|
2001-03-26 08:04:11 +00:00
|
|
|
while : ; do \
|
|
|
|
case $$# in \
|
|
|
|
0) break;; \
|
|
|
|
1) echo "warn: missing extension: $$1"; break;; \
|
|
|
|
esac; \
|
|
|
|
page=$$1; shift; sect=$$1; shift; \
|
|
|
|
d=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}; \
|
|
|
|
${ECHO} ${MINSTALL} $${page} $${d}; \
|
|
|
|
${MINSTALL} $${page} $${d}; \
|
|
|
|
done
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __page in ${MAN}
|
|
|
|
${MINSTALL} ${__page:T:S/$/${CATEXT}/} \
|
|
|
|
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T}
|
1997-07-24 18:39:46 +00:00
|
|
|
.endfor
|
|
|
|
.endif
|
1996-09-16 14:13:40 +00:00
|
|
|
.endif
|
1994-08-04 21:09:27 +00:00
|
|
|
.else
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __page in ${MAN}
|
|
|
|
${MINSTALL} ${__page:T:S/$/${MCOMPRESS_EXT}/g} \
|
|
|
|
${DESTDIR}${MANDIR}${__page:E}${MANSUBDIR}
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
2007-03-12 13:54:52 +00:00
|
|
|
${MINSTALL} ${__page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} \
|
|
|
|
${DESTDIR}${CATDIR}${__page:E}${MANSUBDIR}/${__page:T:S/$/${MCOMPRESS_EXT}/}
|
1997-07-24 18:39:46 +00:00
|
|
|
.endif
|
2001-03-26 08:04:11 +00:00
|
|
|
.endfor
|
1994-08-04 21:09:27 +00:00
|
|
|
.endif
|
1994-05-30 19:09:18 +00:00
|
|
|
.endif
|
1995-10-14 08:16:04 +00:00
|
|
|
|
2004-12-21 09:44:43 +00:00
|
|
|
.if !defined(NO_MLINKS) && defined(MLINKS) && !empty(MLINKS)
|
2003-09-07 12:59:22 +00:00
|
|
|
@set ${MLINKS:C/\.([^.]*)$/.\1 \1/}; \
|
1996-05-25 21:50:54 +00:00
|
|
|
while : ; do \
|
|
|
|
case $$# in \
|
|
|
|
0) break;; \
|
|
|
|
[123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \
|
|
|
|
esac; \
|
|
|
|
name=$$1; shift; sect=$$1; shift; \
|
|
|
|
l=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
|
|
|
|
name=$$1; shift; sect=$$1; shift; \
|
|
|
|
t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
|
1994-08-28 15:37:40 +00:00
|
|
|
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
|
1997-03-08 23:46:56 +00:00
|
|
|
rm -f $${t} $${t}${MCOMPRESS_EXT}; \
|
2013-01-21 22:40:39 +00:00
|
|
|
${INSTALL_LINK} $${l}${ZEXT} $${t}${ZEXT}; \
|
1996-05-25 21:50:54 +00:00
|
|
|
done
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
2003-09-07 12:59:22 +00:00
|
|
|
@set ${MLINKS:C/\.([^.]*)$/.\1 \1/}; \
|
1997-07-24 18:39:46 +00:00
|
|
|
while : ; do \
|
|
|
|
case $$# in \
|
|
|
|
0) break;; \
|
|
|
|
[123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \
|
|
|
|
esac; \
|
|
|
|
name=$$1; shift; sect=$$1; shift; \
|
|
|
|
l=${DESTDIR}${CATDIR}$${sect}${MANSUBDIR}/$$name; \
|
|
|
|
name=$$1; shift; sect=$$1; shift; \
|
|
|
|
t=${DESTDIR}${CATDIR}$${sect}${MANSUBDIR}/$$name; \
|
|
|
|
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
|
|
|
|
rm -f $${t} $${t}${MCOMPRESS_EXT}; \
|
2013-01-21 22:40:39 +00:00
|
|
|
${INSTALL_LINK} $${l}${ZEXT} $${t}${ZEXT}; \
|
1997-07-24 18:39:46 +00:00
|
|
|
done
|
|
|
|
.endif
|
1994-05-30 19:09:18 +00:00
|
|
|
.endif
|
2001-09-05 11:24:34 +00:00
|
|
|
|
|
|
|
manlint:
|
|
|
|
.if defined(MAN) && !empty(MAN)
|
2007-03-12 13:54:52 +00:00
|
|
|
.for __page in ${MAN}
|
|
|
|
manlint: ${__page}lint
|
|
|
|
${__page}lint: ${__page}
|
2001-09-05 11:24:34 +00:00
|
|
|
.if defined(MANFILTER)
|
2015-01-02 13:54:03 +00:00
|
|
|
${MANFILTER} < ${.ALLSRC} | ${MANDOC_CMD} -Tlint
|
2001-09-05 11:24:34 +00:00
|
|
|
.else
|
2015-01-02 13:54:03 +00:00
|
|
|
${MANDOC_CMD} -Tlint ${.ALLSRC}
|
2001-09-05 11:24:34 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endif
|