1# $Id: bsd.man.mk,v 1.9 1996/03/24 00:08:02 wosch Exp $
| 1# $Id: bsd.man.mk,v 1.10 1996/04/09 23:10:19 wosch Exp $
|
2 3.if exists(${.CURDIR}/../Makefile.inc) 4.include "${.CURDIR}/../Makefile.inc" 5.endif 6 7MANSRC?= ${.CURDIR} 8MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} 9 10MCOMPRESS= gzip -c 11ZEXTENSION= .gz 12 13SECTIONS= 1 2 3 3f 4 5 6 7 8 9 14 15.undef _MANPAGES 16.for sect in ${SECTIONS} 17.if defined(MAN${sect}) && !empty(MAN${sect}) 18.SUFFIXES: .${sect} 19.PATH.${sect}: ${MANSRC} 20_MANPAGES+= ${MAN${sect}} 21.endif 22.endfor 23 24all-man: ${MANDEPEND} 25 26.if defined(NOMANCOMPRESS) 27 28COPY= -c 29ZEXT= 30 31.else 32 33ZEXT= ${ZEXTENSION} 34 35.for sect in ${SECTIONS} 36.if defined(MAN${sect}) && !empty(MAN${sect}) 37CLEANFILES+= ${MAN${sect}:T:S/$/${ZEXTENSION}/g} 38.for page in ${MAN${sect}} 39.for target in ${page:T:S/$/${ZEXTENSION}/} 40all-man: ${target} 41${target}: ${page} 42 ${MCOMPRESS} ${.ALLSRC} > ${.TARGET} 43.endfor 44.endfor 45.endif 46.endfor 47 48.endif 49 50maninstall:: 51.for sect in ${SECTIONS} 52.if defined(MAN${sect}) && !empty(MAN${sect}) 53maninstall:: ${MAN${sect}} 54.if defined(NOMANCOMPRESS) 55 ${MINSTALL} ${.ALLSRC} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR} 56.else 57 ${MINSTALL} ${.ALLSRC:T:S/$/${ZEXTENSION}/g} \ 58 ${DESTDIR}${MANDIR}${sect}${MANSUBDIR} 59.endif 60.endif 61.endfor 62 63.if defined(MLINKS) && !empty(MLINKS)
| 2 3.if exists(${.CURDIR}/../Makefile.inc) 4.include "${.CURDIR}/../Makefile.inc" 5.endif 6 7MANSRC?= ${.CURDIR} 8MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} 9 10MCOMPRESS= gzip -c 11ZEXTENSION= .gz 12 13SECTIONS= 1 2 3 3f 4 5 6 7 8 9 14 15.undef _MANPAGES 16.for sect in ${SECTIONS} 17.if defined(MAN${sect}) && !empty(MAN${sect}) 18.SUFFIXES: .${sect} 19.PATH.${sect}: ${MANSRC} 20_MANPAGES+= ${MAN${sect}} 21.endif 22.endfor 23 24all-man: ${MANDEPEND} 25 26.if defined(NOMANCOMPRESS) 27 28COPY= -c 29ZEXT= 30 31.else 32 33ZEXT= ${ZEXTENSION} 34 35.for sect in ${SECTIONS} 36.if defined(MAN${sect}) && !empty(MAN${sect}) 37CLEANFILES+= ${MAN${sect}:T:S/$/${ZEXTENSION}/g} 38.for page in ${MAN${sect}} 39.for target in ${page:T:S/$/${ZEXTENSION}/} 40all-man: ${target} 41${target}: ${page} 42 ${MCOMPRESS} ${.ALLSRC} > ${.TARGET} 43.endfor 44.endfor 45.endif 46.endfor 47 48.endif 49 50maninstall:: 51.for sect in ${SECTIONS} 52.if defined(MAN${sect}) && !empty(MAN${sect}) 53maninstall:: ${MAN${sect}} 54.if defined(NOMANCOMPRESS) 55 ${MINSTALL} ${.ALLSRC} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR} 56.else 57 ${MINSTALL} ${.ALLSRC:T:S/$/${ZEXTENSION}/g} \ 58 ${DESTDIR}${MANDIR}${sect}${MANSUBDIR} 59.endif 60.endif 61.endfor 62 63.if defined(MLINKS) && !empty(MLINKS)
|
64 @set ${MLINKS}; \ 65 while test $$# -ge 2; do \ 66 name=$$1; \ 67 shift; \ 68 sect=`expr $$name : '.*\.\([^.]*\)'`; \ 69 dir=${DESTDIR}${MANDIR}$$sect; \ 70 l=$${dir}${MANSUBDIR}/$$name; \ 71 name=$$1; \ 72 shift; \ 73 sect=`expr $$name : '.*\.\([^.]*\)'`; \ 74 dir=${DESTDIR}${MANDIR}$$sect; \ 75 t=$${dir}${MANSUBDIR}/$$name; \
| 64 @set `echo ${MLINKS} " " | sed 's/\.\([^.]*\) /.\1 \1 /g'`; \ 65 while : ; do \ 66 case $$# in \ 67 0) break;; \ 68 [123]) echo "warn: empty MLINK: $$1 $$2 $$3"; break;; \ 69 esac; \ 70 name=$$1; shift; sect=$$1; shift; \ 71 l=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \ 72 name=$$1; shift; sect=$$1; shift; \ 73 t=${DESTDIR}${MANDIR}$${sect}${MANSUBDIR}/$$name; \
|
76 ${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \ 77 rm -f $${t} $${t}${ZEXTENSION}; \ 78 ln $${l}${ZEXT} $${t}${ZEXT}; \
| 74 ${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \ 75 rm -f $${t} $${t}${ZEXTENSION}; \ 76 ln $${l}${ZEXT} $${t}${ZEXT}; \
|
79 done; true
| 77 done
|
80.endif
| 78.endif
|