1997-05-07 01:29:33 +04:00
|
|
|
# $NetBSD: bsd.man.mk,v 1.29 1997/05/06 21:29:41 mycroft 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
|
|
|
|
1993-08-16 00:59:36 +04:00
|
|
|
.if !target(.MAIN)
|
1993-03-21 12:45:37 +03:00
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
|
|
|
|
1997-05-07 00:54:31 +04:00
|
|
|
.MAIN: all
|
1993-08-16 00:59:36 +04:00
|
|
|
.endif
|
1997-05-07 00:54:31 +04:00
|
|
|
.PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman
|
|
|
|
|
|
|
|
MANTARGET?= cat
|
|
|
|
NROFF?= nroff
|
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
|
|
|
|
1995-11-25 22:53:33 +03:00
|
|
|
.9.cat9 .8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1:
|
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)
|
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/}
|
1994-12-23 14:19:21 +03:00
|
|
|
.endif
|
1994-01-31 21:40:10 +03:00
|
|
|
|
1996-10-18 06:34:42 +04:00
|
|
|
MINSTALL= ${INSTALL} ${COPY} -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 source page installation
|
|
|
|
.if defined(MANPAGES) && !empty(MANPAGES)
|
|
|
|
. for P in ${MANPAGES}
|
1997-04-15 20:57:46 +04:00
|
|
|
manpages:: ${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}
|
1997-03-25 00:54:12 +03:00
|
|
|
. if !defined(UPDATE)
|
1997-04-15 20:57:46 +04:00
|
|
|
.PHONY: ${DESTDIR}${MANDIR}/${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}
|
1997-03-25 00:54:12 +03:00
|
|
|
. endif
|
|
|
|
|
1997-05-07 01:29:33 +04:00
|
|
|
.PRECIOUS: ${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}
|
1997-04-15 20:57:46 +04:00
|
|
|
${DESTDIR}${MANDIR}/man${P:T:E}${MANSUBDIR}/${P}${MCOMPRESSSUFFIX}: ${P} __installpage
|
1997-03-25 00:54:12 +03:00
|
|
|
. endfor
|
|
|
|
.else
|
|
|
|
manpages::
|
|
|
|
.endif
|
|
|
|
|
|
|
|
# Rules for cat'ed man page installation
|
|
|
|
.if defined(CATPAGES) && !empty(CATPAGES)
|
|
|
|
. 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
|
|
|
|
. if !defined(BUILD)
|
|
|
|
${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
|
|
|
|
|
|
|
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}; \
|
1997-03-25 00:54:12 +03:00
|
|
|
if [ ! -f $$t -o -z "${UPDATE}" ]; then \
|
|
|
|
echo $$t -\> $$l; \
|
|
|
|
rm -f $$t; \
|
|
|
|
ln $$l $$t; \
|
|
|
|
fi; \
|
1995-06-07 05:15:20 +04:00
|
|
|
done
|
1993-03-21 12:45:37 +03:00
|
|
|
.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}; \
|
1997-03-25 00:54:12 +03:00
|
|
|
if [ ! -f $$t -o -z "${UPDATE}" ]; then \
|
|
|
|
echo $$t -\> $$l; \
|
|
|
|
rm -f $$t; \
|
|
|
|
ln $$l $$t; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
.endif
|
|
|
|
.if defined(CATPAGES)
|
|
|
|
all: ${CATPAGES}
|
1993-08-16 00:42:39 +04:00
|
|
|
|
|
|
|
cleandir: cleanman
|
|
|
|
cleanman:
|
1997-03-25 00:54:12 +03:00
|
|
|
rm -f ${CATPAGES}
|
1993-08-16 00:42:39 +04:00
|
|
|
.endif
|