1996-03-24 00:08:02 +00:00
|
|
|
# $Id: bsd.man.mk,v 1.8 1995/12/14 18:13:14 bde Exp $
|
1995-10-14 08:16:04 +00:00
|
|
|
|
|
|
|
.if exists(${.CURDIR}/../Makefile.inc)
|
|
|
|
.include "${.CURDIR}/../Makefile.inc"
|
|
|
|
.endif
|
1994-05-30 19:09:18 +00:00
|
|
|
|
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
|
|
|
|
1995-10-14 08:16:04 +00:00
|
|
|
MCOMPRESS= gzip -c
|
1994-08-04 21:09:27 +00:00
|
|
|
ZEXTENSION= .gz
|
|
|
|
|
1995-12-14 18:13:14 +00:00
|
|
|
SECTIONS= 1 2 3 3f 4 5 6 7 8 9
|
1994-05-30 19:09:18 +00:00
|
|
|
|
1995-10-21 18:18:46 +00:00
|
|
|
.for sect in ${SECTIONS}
|
|
|
|
.if defined(MAN${sect}) && !empty(MAN${sect})
|
|
|
|
.SUFFIXES: .${sect}
|
|
|
|
.PATH.${sect}: ${MANSRC}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
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
|
1995-10-14 08:16:04 +00:00
|
|
|
ZEXT=
|
|
|
|
|
|
|
|
.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}
|
|
|
|
${MCOMPRESS} ${.ALLSRC} > ${.TARGET}
|
1995-10-02 20:02:05 +00:00
|
|
|
.endfor
|
|
|
|
.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)
|
1995-10-21 18:18:46 +00:00
|
|
|
${MINSTALL} ${.ALLSRC} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
|
1994-08-04 21:09:27 +00:00
|
|
|
.else
|
1995-10-21 18:18:46 +00:00
|
|
|
${MINSTALL} ${.ALLSRC:T:S/$/${ZEXTENSION}/g} \
|
1995-10-14 08:16:04 +00:00
|
|
|
${DESTDIR}${MANDIR}${sect}${MANSUBDIR}
|
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
|
|
|
|
1994-05-30 19:09:18 +00:00
|
|
|
.if defined(MLINKS) && !empty(MLINKS)
|
|
|
|
@set ${MLINKS}; \
|
|
|
|
while test $$# -ge 2; do \
|
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
1994-08-04 21:09:27 +00:00
|
|
|
sect=`expr $$name : '.*\.\([^.]*\)'`; \
|
|
|
|
dir=${DESTDIR}${MANDIR}$$sect; \
|
|
|
|
l=$${dir}${MANSUBDIR}/$$name; \
|
1994-05-30 19:09:18 +00:00
|
|
|
name=$$1; \
|
|
|
|
shift; \
|
1994-08-04 21:09:27 +00:00
|
|
|
sect=`expr $$name : '.*\.\([^.]*\)'`; \
|
|
|
|
dir=${DESTDIR}${MANDIR}$$sect; \
|
|
|
|
t=$${dir}${MANSUBDIR}/$$name; \
|
1994-08-28 15:37:40 +00:00
|
|
|
${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \
|
1995-10-14 08:16:04 +00:00
|
|
|
rm -f $${t} $${t}${ZEXTENSION}; \
|
1994-08-04 21:09:27 +00:00
|
|
|
ln $${l}${ZEXT} $${t}${ZEXT}; \
|
1994-05-30 19:09:18 +00:00
|
|
|
done; true
|
|
|
|
.endif
|