1999-08-28 00:22:10 +00:00
|
|
|
# $FreeBSD$
|
1996-05-25 23:09:49 +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
|
|
|
|
# linked-to file must come first, the linked file
|
|
|
|
# second, and there may be multiple pairs. The files
|
|
|
|
# are hard-linked.
|
|
|
|
#
|
|
|
|
# NOMANCOMPRESS If you do not want unformatted manual pages to be
|
|
|
|
# compressed when they are installed. [not set]
|
|
|
|
#
|
1996-12-26 22:37:30 +00:00
|
|
|
# NOMLINKS If you do not want install manual page links. [not set]
|
|
|
|
#
|
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.
|
|
|
|
#
|
|
|
|
|
1995-10-14 08:16:04 +00:00
|
|
|
MINSTALL= ${INSTALL} ${COPY} -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
|
2001-07-12 07:47:39 +00:00
|
|
|
MROFF_CMD?= groff -Tascii -mtty-char -man -t
|
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
|
|
|
|
2001-03-28 14:58:08 +00:00
|
|
|
SECTIONS= 1 1aout 2 3 4 5 6 7 8 9
|
|
|
|
.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)
|
|
|
|
.for sect in ${SECTIONS}
|
2001-03-26 08:04:11 +00:00
|
|
|
.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
|
|
|
|
2001-03-26 08:04:11 +00:00
|
|
|
all-man:
|
1995-10-02 20:02:05 +00:00
|
|
|
|
1995-10-14 08:16:04 +00:00
|
|
|
.if defined(NOMANCOMPRESS)
|
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
|
|
|
|
# for NOMANCOMPRESS.
|
|
|
|
.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}
|
|
|
|
.for page in ${MAN}
|
1996-09-16 14:13:40 +00:00
|
|
|
.for target in ${page:T:S/$/${FILTEXTENSION}/g}
|
1996-08-11 12:31:57 +00:00
|
|
|
all-man: ${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)
|
1997-07-24 18:39:46 +00:00
|
|
|
.for target in ${page:T:S/$/${CATEXT}${FILTEXTENSION}/g}
|
|
|
|
all-man: ${target}
|
|
|
|
${target}: ${page}
|
|
|
|
${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)
|
2001-03-26 08:04:11 +00:00
|
|
|
.for page in ${MAN}
|
1997-07-24 18:39:46 +00:00
|
|
|
.for target in ${page:T:S/$/${CATEXT}/g}
|
|
|
|
all-man: ${target}
|
|
|
|
${target}: ${page}
|
|
|
|
${MROFF_CMD} ${.ALLSRC} > ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
.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}
|
|
|
|
.for page in ${MAN}
|
1997-03-08 23:46:56 +00:00
|
|
|
.for target in ${page:T:S/$/${MCOMPRESS_EXT}/}
|
1995-10-14 08:16:04 +00:00
|
|
|
all-man: ${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)
|
1997-07-24 18:39:46 +00:00
|
|
|
.for target in ${page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/}
|
|
|
|
all-man: ${target}
|
|
|
|
${target}: ${page}
|
|
|
|
.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
|
|
|
|
|
1995-10-21 18:18:46 +00:00
|
|
|
maninstall::
|
2001-03-26 08:04:11 +00:00
|
|
|
.if defined(MAN) && !empty(MAN)
|
|
|
|
maninstall:: ${MAN}
|
1995-10-02 20:02:05 +00:00
|
|
|
.if defined(NOMANCOMPRESS)
|
1996-09-16 14:13:40 +00:00
|
|
|
.if defined(MANFILTER)
|
2001-03-26 08:04:11 +00:00
|
|
|
.for page in ${MAN}
|
1997-07-24 18:39:46 +00:00
|
|
|
${MINSTALL} ${page:T:S/$/${FILTEXTENSION}/g} \
|
2001-03-26 08:04:11 +00:00
|
|
|
${DESTDIR}${MANDIR}${page:E}${MANSUBDIR}/${page}
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
1997-07-24 18:39:46 +00:00
|
|
|
${MINSTALL} ${page:T:S/$/${CATEXT}${FILTEXTENSION}/g} \
|
2001-03-26 08:04:11 +00:00
|
|
|
${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
|
2001-03-26 08:04:11 +00:00
|
|
|
@set `echo ${.ALLSRC} " " | sed 's/\.\([^.]*\) /.\1 \1 /g'`; \
|
|
|
|
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)
|
2001-03-26 08:04:11 +00:00
|
|
|
.for page in ${MAN}
|
1997-07-24 18:39:46 +00:00
|
|
|
${MINSTALL} ${page:T:S/$/${CATEXT}/} \
|
2001-03-26 08:04:11 +00:00
|
|
|
${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
|
2001-03-26 08:04:11 +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)
|
1997-07-24 18:39:46 +00:00
|
|
|
${MINSTALL} ${page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} \
|
2001-03-26 08:04:11 +00:00
|
|
|
${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
|
|
|
|
1996-12-26 22:37:30 +00:00
|
|
|
.if !defined(NOMLINKS) && defined(MLINKS) && !empty(MLINKS)
|
1996-05-25 21:50:54 +00:00
|
|
|
@set `echo ${MLINKS} " " | sed 's/\.\([^.]*\) /.\1 \1 /g'`; \
|
|
|
|
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}; \
|
1994-08-04 21:09:27 +00:00
|
|
|
ln $${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)
|
1997-07-24 18:39:46 +00:00
|
|
|
@set `echo ${MLINKS} " " | sed 's/\.\([^.]*\) /.\1 \1 /g'`; \
|
|
|
|
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}; \
|
|
|
|
ln $${l}${ZEXT} $${t}${ZEXT}; \
|
|
|
|
done
|
|
|
|
.endif
|
1994-05-30 19:09:18 +00:00
|
|
|
.endif
|