2000-02-20 01:54:08 +03:00
|
|
|
# $NetBSD: bsd.man.mk,v 1.51 2000/02/19 22:54:08 erh Exp $
|
1997-03-29 11:02:45 +03:00
|
|
|
# @(#)bsd.man.mk 8.1 (Berkeley) 6/8/93
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-10-11 12:16:24 +04:00
|
|
|
.if !target(__initialized__)
|
|
|
|
__initialized__:
|
1993-03-21 12:45:37 +03:00
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
1997-10-11 12:16:24 +04:00
|
|
|
.include <bsd.own.mk>
|
|
|
|
.include <bsd.obj.mk>
|
1999-09-14 05:31:11 +04:00
|
|
|
.include <bsd.depall.mk>
|
1997-05-07 00:54:31 +04:00
|
|
|
.MAIN: all
|
1993-08-16 00:59:36 +04:00
|
|
|
.endif
|
1997-10-11 12:16:24 +04:00
|
|
|
|
1997-05-07 00:54:31 +04:00
|
|
|
.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman
|
1999-02-12 15:38:44 +03:00
|
|
|
.if ${MKMAN} != "no"
|
1997-05-09 17:25:46 +04:00
|
|
|
realinstall: ${MANINSTALL}
|
1997-10-11 12:16:24 +04:00
|
|
|
.endif
|
1998-08-09 18:46:19 +04:00
|
|
|
cleandir distclean: cleanman
|
1997-05-07 00:54:31 +04:00
|
|
|
|
1998-02-15 04:07:46 +03:00
|
|
|
TMACDIR?= ${DESTDIR}/usr/share/tmac
|
|
|
|
CATDEPS?= ${TMACDIR}/tmac.andoc \
|
|
|
|
${TMACDIR}/tmac.doc \
|
|
|
|
${TMACDIR}/tmac.doc-ditroff \
|
|
|
|
${TMACDIR}/tmac.doc-common \
|
|
|
|
${TMACDIR}/tmac.doc-nroff \
|
|
|
|
${TMACDIR}/tmac.doc-syms
|
1997-05-07 00:54:31 +04:00
|
|
|
MANTARGET?= cat
|
1999-04-16 22:56:19 +04:00
|
|
|
NROFF?= nroff -Tascii
|
1997-06-30 23:26:21 +04:00
|
|
|
TBL?= tbl
|
1993-08-16 00:59:36 +04:00
|
|
|
|
1997-03-25 00:54:12 +03:00
|
|
|
.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .9 \
|
|
|
|
.cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9
|
1994-01-31 21:40:10 +03:00
|
|
|
|
1998-02-15 04:07:46 +03:00
|
|
|
.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1: \
|
|
|
|
${CATDEPS}
|
1997-06-30 23:26:21 +04:00
|
|
|
.if !defined(USETBL)
|
1996-01-15 04:56:09 +03:00
|
|
|
@echo "${NROFF} -mandoc ${.IMPSRC} > ${.TARGET}"
|
1997-03-25 00:54:12 +03:00
|
|
|
@${NROFF} -mandoc ${.IMPSRC} > ${.TARGET} || \
|
|
|
|
(rm -f ${.TARGET}; false)
|
1997-06-30 23:26:21 +04:00
|
|
|
.else
|
|
|
|
@echo "${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET}"
|
|
|
|
@${TBL} ${.IMPSRC} | ${NROFF} -mandoc > ${.TARGET} || \
|
|
|
|
(rm -f ${.TARGET}; false)
|
|
|
|
.endif
|
1994-01-31 21:40:10 +03:00
|
|
|
|
1994-12-23 14:19:21 +03:00
|
|
|
.if defined(MAN) && !empty(MAN)
|
1997-03-25 00:54:12 +03:00
|
|
|
MANPAGES= ${MAN}
|
|
|
|
CATPAGES= ${MANPAGES:C/(.*).([1-9])/\1.cat\2/}
|
2000-02-20 01:54:08 +03:00
|
|
|
.NOPATH: ${CATPAGES}
|
1994-12-23 14:19:21 +03:00
|
|
|
.endif
|
1994-01-31 21:40:10 +03:00
|
|
|
|
1999-08-21 10:17:45 +04:00
|
|
|
MINSTALL= ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} \
|
|
|
|
-o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
|
1997-03-25 00:54:12 +03:00
|
|
|
|
1995-06-07 05:15:20 +04:00
|
|
|
.if defined(MANZ)
|
|
|
|
# chown and chmod are done afterward automatically
|
|
|
|
MCOMPRESS= gzip -cf
|
|
|
|
MCOMPRESSSUFFIX= .gz
|
|
|
|
.endif
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1997-03-25 00:54:12 +03:00
|
|
|
catinstall: catlinks
|
|
|
|
maninstall: manlinks
|
|
|
|
|
|
|
|
__installpage: .USE
|
|
|
|
.if defined(MCOMPRESS) && !empty(MCOMPRESS)
|
|
|
|
@rm -f ${.TARGET}
|
|
|
|
${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
|
|
|
|
@chown ${MANOWN}:${MANGRP} ${.TARGET}
|
|
|
|
@chmod ${MANMODE} ${.TARGET}
|
|
|
|
.else
|
|
|
|
${MINSTALL} ${.ALLSRC} ${.TARGET}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
|
|
|
|
# Rules for cat'ed man page installation
|
1999-02-12 04:10:06 +03:00
|
|
|
.if defined(CATPAGES) && !empty(CATPAGES) && ${MKCATPAGES} != "no"
|
1997-03-25 00:54:12 +03:00
|
|
|
. for P in ${CATPAGES}
|
|
|
|
catpages:: ${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}
|
|
|
|
|
|
|
|
. if !defined(UPDATE)
|
|
|
|
.PHONY: ${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}
|
|
|
|
. endif
|
1999-09-05 01:48:33 +04:00
|
|
|
. if !defined(BUILD) && !make(all) && !make(${P})
|
1997-03-25 00:54:12 +03:00
|
|
|
${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: .MADE
|
|
|
|
. endif
|
|
|
|
|
1997-05-07 01:29:33 +04:00
|
|
|
.PRECIOUS: ${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}
|
1997-03-25 00:54:12 +03:00
|
|
|
${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P:T:R}.0${MCOMPRESSSUFFIX}: ${P} __installpage
|
|
|
|
. endfor
|
|
|
|
.else
|
|
|
|
catpages::
|
1995-06-02 06:52:04 +04:00
|
|
|
.endif
|
1997-03-25 00:54:12 +03:00
|
|
|
|
1997-05-07 19:53:28 +04:00
|
|
|
# Rules for source page installation
|
|
|
|
.if defined(MANPAGES) && !empty(MANPAGES)
|
|
|
|
. for P in ${MANPAGES}
|
|
|
|
manpages:: ${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}
|
|
|
|
. if !defined(UPDATE)
|
1997-12-02 11:42:28 +03:00
|
|
|
.PHONY: ${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}
|
1997-05-07 19:53:28 +04:00
|
|
|
. endif
|
|
|
|
|
|
|
|
.PRECIOUS: ${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}
|
|
|
|
${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
|
|
|
|
. endfor
|
|
|
|
.else
|
|
|
|
manpages::
|
|
|
|
.endif
|
|
|
|
|
1999-02-12 04:10:06 +03:00
|
|
|
.if ${MKCATPAGES} != "no"
|
1997-03-25 00:54:12 +03:00
|
|
|
catlinks: catpages
|
1993-03-21 12:45:37 +03:00
|
|
|
.if defined(MLINKS) && !empty(MLINKS)
|
|
|
|
@set ${MLINKS}; \
|
|
|
|
while test $$# -ge 2; do \
|
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
1997-03-25 00:54:12 +03:00
|
|
|
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
|
1996-02-10 10:49:33 +03:00
|
|
|
l=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
|
1993-03-21 12:45:37 +03:00
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
1997-03-25 00:54:12 +03:00
|
|
|
dir=${DESTDIR}${MANDIR}/cat$${name##*.}; \
|
1996-02-10 10:49:33 +03:00
|
|
|
t=$${dir}${MANSUBDIR}/$${name%.*}.0${MCOMPRESSSUFFIX}; \
|
1998-04-10 02:08:36 +04:00
|
|
|
if [ -z "${UPDATE}" -o ! -f $$t ]; then \
|
1997-03-25 00:54:12 +03:00
|
|
|
echo $$t -\> $$l; \
|
1998-04-10 02:08:36 +04:00
|
|
|
ln -f $$l $$t; \
|
1997-03-25 00:54:12 +03:00
|
|
|
fi; \
|
1995-06-07 05:15:20 +04:00
|
|
|
done
|
1993-03-21 12:45:37 +03:00
|
|
|
.endif
|
1999-02-12 04:10:06 +03:00
|
|
|
.else
|
|
|
|
catlinks:
|
|
|
|
.endif
|
1993-08-16 00:42:39 +04:00
|
|
|
|
1997-03-25 00:54:12 +03:00
|
|
|
manlinks: manpages
|
|
|
|
.if defined(MLINKS) && !empty(MLINKS)
|
|
|
|
@set ${MLINKS}; \
|
|
|
|
while test $$# -ge 2; do \
|
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
|
|
|
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
|
1997-04-15 20:57:46 +04:00
|
|
|
l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
|
1997-03-25 00:54:12 +03:00
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
|
|
|
dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
|
1997-04-15 20:57:46 +04:00
|
|
|
t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
|
1998-04-10 02:08:36 +04:00
|
|
|
if [ -z "${UPDATE}" -o ! -f $$t ]; then \
|
1997-03-25 00:54:12 +03:00
|
|
|
echo $$t -\> $$l; \
|
1998-04-10 02:08:36 +04:00
|
|
|
ln -f $$l $$t; \
|
1997-03-25 00:54:12 +03:00
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.endif
|
1997-05-07 20:45:40 +04:00
|
|
|
|
1997-03-25 00:54:12 +03:00
|
|
|
.if defined(CATPAGES)
|
1999-02-13 19:34:39 +03:00
|
|
|
.if ${MKCATPAGES} != "no" && ${MKMAN} != "no"
|
2000-01-22 22:31:00 +03:00
|
|
|
realall: ${CATPAGES}
|
1997-10-30 15:57:19 +03:00
|
|
|
.else
|
2000-01-22 22:31:00 +03:00
|
|
|
realall:
|
1997-10-11 12:16:24 +04:00
|
|
|
.endif
|
1993-08-16 00:42:39 +04:00
|
|
|
|
|
|
|
cleanman:
|
1997-03-25 00:54:12 +03:00
|
|
|
rm -f ${CATPAGES}
|
1997-05-07 20:45:40 +04:00
|
|
|
.else
|
|
|
|
cleanman:
|
1993-08-16 00:42:39 +04:00
|
|
|
.endif
|
1997-10-11 12:16:24 +04:00
|
|
|
|
|
|
|
# Make sure all of the standard targets are defined, even if they do nothing.
|
|
|
|
clean depend includes lint regress tags:
|