1995-06-07 05:15:20 +04:00
|
|
|
# $NetBSD: bsd.man.mk,v 1.20 1995/06/07 01:15:20 cgd Exp $
|
1994-06-30 09:31:04 +04:00
|
|
|
# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
|
1993-03-21 12:45:37 +03:00
|
|
|
|
1995-06-02 06:52:04 +04:00
|
|
|
MANTARGET?= cat
|
|
|
|
|
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
|
|
|
|
|
1993-08-16 00:59:36 +04:00
|
|
|
.MAIN: all
|
|
|
|
.endif
|
|
|
|
|
1994-12-22 12:20:40 +03:00
|
|
|
.SUFFIXES: .1 .2 .3 .4 .5 .6 .7 .8 .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 \
|
|
|
|
.cat7 .cat8
|
1994-01-31 21:40:10 +03:00
|
|
|
|
1994-12-22 12:20:40 +03:00
|
|
|
.8.cat8 .7.cat7 .6.cat6 .5.cat5 .4.cat4 .3.cat3 .2.cat2 .1.cat1:
|
1994-01-31 21:40:10 +03:00
|
|
|
@echo "nroff -mandoc ${.IMPSRC} > ${.TARGET}"
|
|
|
|
@nroff -mandoc ${.IMPSRC} > ${.TARGET} || ( rm -f ${.TARGET} ; false )
|
|
|
|
|
1994-12-23 14:19:21 +03:00
|
|
|
.if defined(MAN) && !empty(MAN)
|
1994-12-22 12:20:40 +03:00
|
|
|
MANALL= ${MAN:S/.1$/.cat1/g:S/.2$/.cat2/g:S/.3$/.cat3/g:S/.4$/.cat4/g:S/.5$/.cat5/g:S/.6$/.cat6/g:S/.7$/.cat7/g:S/.8$/.cat8/g}
|
1994-12-23 14:19:21 +03:00
|
|
|
.endif
|
1994-01-31 21:40:10 +03:00
|
|
|
|
1993-04-10 00:05:56 +04:00
|
|
|
MINSTALL= install ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
|
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
|
|
|
|
|
|
|
maninstall:
|
1994-12-23 14:19:21 +03:00
|
|
|
.if defined(MANALL)
|
1994-12-22 12:20:40 +03:00
|
|
|
@for page in ${MANALL}; do \
|
|
|
|
dir=${DESTDIR}${MANDIR}`expr $$page : '.*\.cat\([1-8]\)'`; \
|
1995-06-07 05:15:20 +04:00
|
|
|
instpage=$${dir}${MANSUBDIR}/`expr $$page : '\(.*\)\.cat[1-8]'`.0${MCOMPRESSSUFFIX}; \
|
|
|
|
if [ X"${MCOMPRESS}" = X ]; then \
|
|
|
|
echo ${MINSTALL} $$page $$instpage; \
|
|
|
|
${MINSTALL} $$page $$instpage; \
|
|
|
|
else \
|
|
|
|
rm -f $$instpage; \
|
|
|
|
echo ${MCOMPRESS} $$page \> $$instpage; \
|
|
|
|
${MCOMPRESS} $$page > $$instpage; \
|
|
|
|
chown ${MANOWN}:${MANGRP} $$instpage; \
|
|
|
|
chmod ${MANMODE} $$instpage; \
|
|
|
|
fi \
|
1995-06-02 06:52:04 +04:00
|
|
|
done
|
|
|
|
.endif
|
1993-03-21 12:45:37 +03:00
|
|
|
.if defined(MLINKS) && !empty(MLINKS)
|
|
|
|
@set ${MLINKS}; \
|
|
|
|
while test $$# -ge 2; do \
|
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
1994-01-26 02:35:36 +03:00
|
|
|
dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
|
1995-06-07 05:15:20 +04:00
|
|
|
l=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0${MCOMPRESSSUFFIX}; \
|
1993-03-21 12:45:37 +03:00
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
1994-01-26 02:35:36 +03:00
|
|
|
dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
|
1995-06-07 05:15:20 +04:00
|
|
|
t=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0${MCOMPRESSSUFFIX}; \
|
1993-03-21 12:45:37 +03:00
|
|
|
echo $$t -\> $$l; \
|
|
|
|
rm -f $$t; \
|
|
|
|
ln $$l $$t; \
|
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
|
|
|
|
|
|
|
.if defined(MANALL)
|
|
|
|
all: ${MANALL}
|
|
|
|
|
|
|
|
cleandir: cleanman
|
|
|
|
cleanman:
|
|
|
|
rm -f ${MANALL}
|
|
|
|
.endif
|