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.
|
|
|
|
#
|
|
|
|
# MAN${sect} The manual pages to be installed. For sections see
|
|
|
|
# variable ${SECTIONS}
|
|
|
|
#
|
|
|
|
# _MANPAGES List of all man pages to be installed.
|
|
|
|
# (``_MANPAGES=$MAN1 $MAN2 ... $MANn'')
|
|
|
|
#
|
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.
|
|
|
|
#
|
|
|
|
|
1994-08-04 21:09:27 +00:00
|
|
|
MANSRC?= ${.CURDIR}
|
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-02-23 09:35:33 +00:00
|
|
|
MROFF_CMD?= groff -Tascii -man
|
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
|
|
|
|
1998-09-07 05:55:02 +00:00
|
|
|
SECTIONS= 1 1aout 2 3 4 5 6 7 8 9 n
|
1994-05-30 19:09:18 +00:00
|
|
|
|
1996-04-09 23:10:19 +00:00
|
|
|
.undef _MANPAGES
|
1995-10-21 18:18:46 +00:00
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
|
|
|
.SUFFIXES: .${sect}
|
|
|
|
.PATH.${sect}: ${MANSRC}
|
1996-04-09 23:10:19 +00:00
|
|
|
_MANPAGES+= ${MAN${sect}}
|
1995-10-21 18:18:46 +00:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2000-12-05 19:56:50 +00:00
|
|
|
# XXX MANDEPEND is only used for man/man, man/manpath, at and atrun.
|
1997-04-19 14:55:17 +00:00
|
|
|
# It should be named more generally.
|
1995-10-14 08:16:04 +00:00
|
|
|
all-man: ${MANDEPEND}
|
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
|
|
|
|
1995-10-21 18:18:46 +00:00
|
|
|
COPY= -c
|
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)
|
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
1996-09-16 14:13:40 +00:00
|
|
|
CLEANFILES+= ${MAN${sect}:T:S/$/${FILTEXTENSION}/g}
|
1997-07-24 18:39:46 +00:00
|
|
|
CLEANFILES+= ${MAN${sect}:T:S/$/${CATEXT}${FILTEXTENSION}/g}
|
1996-08-11 12:31:57 +00:00
|
|
|
.for page in ${MAN${sect}}
|
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
|
|
|
.endfor
|
|
|
|
.else
|
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
|
|
|
CLEANFILES+= ${MAN${sect}:T:S/$/${CATEXT}/g}
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
1997-07-24 18:39:46 +00:00
|
|
|
.for page in ${MAN${sect}}
|
|
|
|
.for target in ${page:T:S/$/${CATEXT}/g}
|
|
|
|
all-man: ${target}
|
|
|
|
${target}: ${page}
|
|
|
|
${MROFF_CMD} ${.ALLSRC} > ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.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
|
|
|
|
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
1997-03-08 23:46:56 +00:00
|
|
|
CLEANFILES+= ${MAN${sect}:T:S/$/${MCOMPRESS_EXT}/g}
|
1997-07-24 18:39:46 +00:00
|
|
|
CLEANFILES+= ${MAN${sect}:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g}
|
1995-10-14 08:16:04 +00:00
|
|
|
.for page in ${MAN${sect}}
|
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
|
|
|
.endfor
|
|
|
|
|
1994-08-04 21:09:27 +00:00
|
|
|
.endif
|
|
|
|
|
1995-10-21 18:18:46 +00:00
|
|
|
maninstall::
|
1995-10-14 08:16:04 +00:00
|
|
|
.for sect in ${SECTIONS}
|
1995-10-02 20:02:05 +00:00
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
1995-10-21 18:18:46 +00:00
|
|
|
maninstall:: ${MAN${sect}}
|
1995-10-02 20:02:05 +00:00
|
|
|
.if defined(NOMANCOMPRESS)
|
1996-09-16 14:13:40 +00:00
|
|
|
.if defined(MANFILTER)
|
|
|
|
.for page in ${MAN${sect}}
|
1997-07-24 18:39:46 +00:00
|
|
|
${MINSTALL} ${page:T:S/$/${FILTEXTENSION}/g} \
|
|
|
|
${DESTDIR}${MANDIR}${sect}${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} \
|
|
|
|
${DESTDIR}${CATDIR}${sect}${MANSUBDIR}/${page}
|
|
|
|
.endif
|
1996-09-16 14:13:40 +00:00
|
|
|
.endfor
|
|
|
|
.else
|
1995-10-21 18:18:46 +00:00
|
|
|
${MINSTALL} ${.ALLSRC} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
1997-07-24 18:39:46 +00:00
|
|
|
.for page in ${MAN${sect}}
|
|
|
|
${MINSTALL} ${page:T:S/$/${CATEXT}/} \
|
|
|
|
${DESTDIR}${CATDIR}${sect}${MANSUBDIR}/${page:T}
|
|
|
|
.endfor
|
|
|
|
.endif
|
1996-09-16 14:13:40 +00:00
|
|
|
.endif
|
1994-08-04 21:09:27 +00:00
|
|
|
.else
|
1997-03-08 23:46:56 +00:00
|
|
|
${MINSTALL} ${.ALLSRC:T:S/$/${MCOMPRESS_EXT}/g} \
|
1995-10-14 08:16:04 +00:00
|
|
|
${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
|
1997-07-25 11:17:12 +00:00
|
|
|
.if defined(MANBUILDCAT) && !empty(MANBUILDCAT)
|
1997-07-24 18:39:46 +00:00
|
|
|
.for page in ${MAN${sect}}
|
|
|
|
${MINSTALL} ${page:T:S/$/${CATEXT}${MCOMPRESS_EXT}/g} \
|
|
|
|
${DESTDIR}${CATDIR}${sect}${MANSUBDIR}/${page:T:S/$/${MCOMPRESS_EXT}/}
|
|
|
|
.endfor
|
|
|
|
.endif
|
1994-08-04 21:09:27 +00:00
|
|
|
.endif
|
1994-05-30 19:09:18 +00:00
|
|
|
.endif
|
1995-10-02 20:02:05 +00:00
|
|
|
.endfor
|
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
|