1997-01-14 08:20:47 +01:00
|
|
|
# $FreeBSD$
|
1996-05-26 01:09:49 +02:00
|
|
|
#
|
|
|
|
# The include file <bsd.man.mk> handles installing manual pages and
|
|
|
|
# their links. <bsd.man.mk> includes the file named "../Makefile.inc"
|
|
|
|
# if it exists.
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# +++ 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'')
|
|
|
|
#
|
|
|
|
# MCOMPRESS Program to compress man pages. Output is to
|
|
|
|
# stdout. [gzip -c]
|
|
|
|
#
|
|
|
|
# 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 23:37:30 +01:00
|
|
|
# NOMLINKS If you do not want install manual page links. [not set]
|
|
|
|
#
|
1996-08-11 14:31:57 +02:00
|
|
|
# MANFILTER command to pipe the raw man page though before compressing
|
|
|
|
# or installing. Can be used to do sed substitution.
|
1996-05-26 01:09:49 +02:00
|
|
|
#
|
|
|
|
# +++ targets +++
|
|
|
|
#
|
|
|
|
# maninstall:
|
|
|
|
# Install the manual pages and their links.
|
|
|
|
#
|
|
|
|
|
1995-10-14 09:16:04 +01:00
|
|
|
|
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1994-08-04 23:09:27 +02:00
|
|
|
MANSRC?= ${.CURDIR}
|
1995-10-14 09:16:04 +01:00
|
|
|
MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1995-10-14 09:16:04 +01:00
|
|
|
MCOMPRESS= gzip -c
|
1994-08-04 23:09:27 +02:00
|
|
|
ZEXTENSION= .gz
|
|
|
|
|
1996-06-22 08:01:57 +02:00
|
|
|
SECTIONS= 1 2 3 3f 4 5 6 7 8 9 n
|
1994-05-30 21:09:18 +02:00
|
|
|
|
1996-04-10 01:10:19 +02:00
|
|
|
.undef _MANPAGES
|
1995-10-21 19:18:46 +01:00
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
|
|
|
.SUFFIXES: .${sect}
|
|
|
|
.PATH.${sect}: ${MANSRC}
|
1996-04-10 01:10:19 +02:00
|
|
|
_MANPAGES+= ${MAN${sect}}
|
1995-10-21 19:18:46 +01:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
1995-10-14 09:16:04 +01:00
|
|
|
all-man: ${MANDEPEND}
|
1995-10-02 21:02:05 +01:00
|
|
|
|
1995-10-14 09:16:04 +01:00
|
|
|
.if defined(NOMANCOMPRESS)
|
1995-10-02 21:02:05 +01:00
|
|
|
|
1995-10-21 19:18:46 +01:00
|
|
|
COPY= -c
|
1996-09-16 16:13:40 +02: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 09:16:04 +01:00
|
|
|
ZEXT=
|
|
|
|
|
1996-08-11 14:31:57 +02:00
|
|
|
.if defined(MANFILTER)
|
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
1996-09-16 16:13:40 +02:00
|
|
|
CLEANFILES+= ${MAN${sect}:T:S/$/${FILTEXTENSION}/g}
|
1996-08-11 14:31:57 +02:00
|
|
|
.for page in ${MAN${sect}}
|
1996-09-16 16:13:40 +02:00
|
|
|
.for target in ${page:T:S/$/${FILTEXTENSION}/g}
|
1996-08-11 14:31:57 +02:00
|
|
|
all-man: ${target}
|
|
|
|
${target}: ${page}
|
1996-08-26 12:55:32 +02:00
|
|
|
${MANFILTER} < ${.ALLSRC} > ${.TARGET}
|
1996-08-11 14:31:57 +02:00
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
1995-10-14 09:16:04 +01:00
|
|
|
.else
|
|
|
|
|
|
|
|
ZEXT= ${ZEXTENSION}
|
|
|
|
|
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
|
|
|
CLEANFILES+= ${MAN${sect}:T:S/$/${ZEXTENSION}/g}
|
|
|
|
.for page in ${MAN${sect}}
|
|
|
|
.for target in ${page:T:S/$/${ZEXTENSION}/}
|
|
|
|
all-man: ${target}
|
|
|
|
${target}: ${page}
|
1996-08-26 12:55:32 +02:00
|
|
|
.if defined(MANFILTER)
|
|
|
|
${MANFILTER} < ${.ALLSRC} | ${MCOMPRESS} > ${.TARGET}
|
1996-08-11 14:31:57 +02:00
|
|
|
.else
|
1995-10-14 09:16:04 +01:00
|
|
|
${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
|
1996-08-11 14:31:57 +02:00
|
|
|
.endif
|
1995-10-02 21:02:05 +01:00
|
|
|
.endfor
|
|
|
|
.endfor
|
1995-10-14 09:16:04 +01:00
|
|
|
.endif
|
1995-10-02 21:02:05 +01:00
|
|
|
.endfor
|
|
|
|
|
1994-08-04 23:09:27 +02:00
|
|
|
.endif
|
|
|
|
|
1995-10-21 19:18:46 +01:00
|
|
|
maninstall::
|
1995-10-14 09:16:04 +01:00
|
|
|
.for sect in ${SECTIONS}
|
1995-10-02 21:02:05 +01:00
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
1995-10-21 19:18:46 +01:00
|
|
|
maninstall:: ${MAN${sect}}
|
1995-10-02 21:02:05 +01:00
|
|
|
.if defined(NOMANCOMPRESS)
|
1996-09-16 16:13:40 +02:00
|
|
|
.if defined(MANFILTER)
|
|
|
|
.for page in ${MAN${sect}}
|
|
|
|
${MINSTALL} ${page:T:S/$/${FILTEXTENSION}/g} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR}/${page}
|
|
|
|
.endfor
|
|
|
|
.else
|
1995-10-21 19:18:46 +01:00
|
|
|
${MINSTALL} ${.ALLSRC} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
|
1996-09-16 16:13:40 +02:00
|
|
|
.endif
|
1994-08-04 23:09:27 +02:00
|
|
|
.else
|
1995-10-21 19:18:46 +01:00
|
|
|
${MINSTALL} ${.ALLSRC:T:S/$/${ZEXTENSION}/g} \
|
1995-10-14 09:16:04 +01:00
|
|
|
${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
|
1994-08-04 23:09:27 +02:00
|
|
|
.endif
|
1994-05-30 21:09:18 +02:00
|
|
|
.endif
|
1995-10-02 21:02:05 +01:00
|
|
|
.endfor
|
1995-10-14 09:16:04 +01:00
|
|
|
|
1996-12-26 23:37:30 +01:00
|
|
|
.if !defined(NOMLINKS) && defined(MLINKS) && !empty(MLINKS)
|
1996-05-25 23:50:54 +02: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 17:37:40 +02:00
|
|
|
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
|
1995-10-14 09:16:04 +01:00
|
|
|
rm -f $${t} $${t}${ZEXTENSION}; \
|
1994-08-04 23:09:27 +02:00
|
|
|
ln $${l}${ZEXT} $${t}${ZEXT}; \
|
1996-05-25 23:50:54 +02:00
|
|
|
done
|
1994-05-30 21:09:18 +02:00
|
|
|
.endif
|