diff options
author | bde <bde@FreeBSD.org> | 1995-10-14 08:16:04 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1995-10-14 08:16:04 +0000 |
commit | c825093bf81d2ab1cc949ceb05d821cbd63d3422 (patch) | |
tree | 0427edd0f7328c1862222683bb693501e2183b37 /share | |
parent | 5cbfb32a2d547f43d0847baca52ec57d326eb86c (diff) | |
download | FreeBSD-src-c825093bf81d2ab1cc949ceb05d821cbd63d3422.zip FreeBSD-src-c825093bf81d2ab1cc949ceb05d821cbd63d3422.tar.gz |
Fix the support for MANSRC (it was broken by the compression changes):
use .PATH.n to get the dependencies right and to avoid some shell tests.
Remove bogus dependency of individual compressed man pages on MANDEPEND.
Use for loops to avoid duplicated code.
Combine some rm steps in installation of links. Linking still takes too
long.
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/bsd.man.mk | 87 |
1 files changed, 33 insertions, 54 deletions
diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 269b75c..62d15b9 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -1,4 +1,8 @@ -# $Id: bsd.man.mk,v 1.4 1994/12/28 03:50:51 ache Exp $ +# $Id: bsd.man.mk,v 1.5 1995/10/02 20:01:49 wollman Exp $ + +.if exists(${.CURDIR}/../Makefile.inc) +.include "${.CURDIR}/../Makefile.inc" +.endif MANGRP?= bin MANOWN?= bin @@ -6,76 +10,52 @@ MANMODE?= 444 MANDIR?= /usr/share/man/man MANSRC?= ${.CURDIR} -MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} +MINSTALL= ${INSTALL} ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} -MCOMPRESS= gzip -f +MCOMPRESS= gzip -c ZEXTENSION= .gz -.if !defined(NOMANCOMPRESS) -ZEXT= ${ZEXTENSION} -.else -ZEXT= -.endif -MANALL= ${MAN1} ${MAN2} ${MAN3} ${MAN3F} ${MAN4} ${MAN5} \ - ${MAN6} ${MAN7} ${MAN8} +SECTIONS= 1 2 3 3f 4 5 6 7 8 -.if !defined(NOMANCOMPRESS) -.for page in ${MANALL} -${page:T}${ZEXTENSION}: ${MANDEPEND} ${page} - if [ -f ${page} ]; then \ - ${MCOMPRESS} < ${page} > ${.TARGET}; \ - else \ - ${MCOMPRESS} < ${.CURDIR}/${page} > ${.TARGET}; \ - fi +all-man: ${MANDEPEND} -CLEANFILES+= ${page:T}${ZEXTENSION} -.endfor +.if defined(NOMANCOMPRESS) -.for page in ${MAN1} -COMP1+= ${page:T}${ZEXTENSION} -.endfor -.for page in ${MAN2} -COMP2+= ${page:T}${ZEXTENSION} -.endfor -.for page in ${MAN3} -COMP3+= ${page:T}${ZEXTENSION} -.endfor -.for page in ${MAN3F} -COMP3F+= ${page:T}${ZEXTENSION} -.endfor -.for page in ${MAN4} -COMP4+= ${page:T}${ZEXTENSION} -.endfor -.for page in ${MAN5} -COMP5+= ${page:T}${ZEXTENSION} -.endfor -.for page in ${MAN6} -COMP6+= ${page:T}${ZEXTENSION} +ZEXT= + +.else + +ZEXT= ${ZEXTENSION} + +.for sect in ${SECTIONS} +.if defined(MAN${sect}) && !empty(MAN${sect}) +CLEANFILES+= ${MAN${sect}:T:S/$/${ZEXTENSION}/g} +.SUFFIXES: .${sect} +.PATH.${sect}: ${MANSRC} +.for page in ${MAN${sect}} +.for target in ${page:T:S/$/${ZEXTENSION}/} +all-man: ${target} +${target}: ${page} + ${MCOMPRESS} ${.ALLSRC} > ${.TARGET} .endfor -.for page in ${MAN7} -COMP7+= ${page:T}${ZEXTENSION} .endfor -.for page in ${MAN8} -COMP8+= ${page:T}${ZEXTENSION} +.endif .endfor -all-man: ${COMP1} ${COMP2} ${COMP3} ${COMP3F} ${COMP4} \ - ${COMP5} ${COMP6} ${COMP7} ${COMP8} -.else -all-man: ${MANDEPEND} .endif maninstall: -.for sect in 1 2 3 3F 4 5 6 7 8 +.for sect in ${SECTIONS} .if defined(MAN${sect}) && !empty(MAN${sect}) .if defined(NOMANCOMPRESS) - (cd ${MANSRC}; \ - ${MINSTALL} ${MAN${sect}} ${DESTDIR}${MANDIR}${sect:S/F/f/}${MANSUBDIR}) + ${MINSTALL} ${MAN${sect}} ${DESTDIR}${MANDIR}${sect}${MANSUBDIR} .else - ${MINSTALL} ${COMP${sect}} ${DESTDIR}${MANDIR}${sect:S/F/f/}${MANSUBDIR} + ${MINSTALL} ${MAN${sect}:T:S/$/${ZEXTENSION}/g} \ + ${DESTDIR}${MANDIR}${sect}${MANSUBDIR} .endif .endif .endfor + .if defined(MLINKS) && !empty(MLINKS) @set ${MLINKS}; \ while test $$# -ge 2; do \ @@ -90,8 +70,7 @@ maninstall: dir=${DESTDIR}${MANDIR}$$sect; \ t=$${dir}${MANSUBDIR}/$$name; \ ${ECHO} $${t}${ZEXT} -\> $${l}${ZEXT}; \ - rm -f $${t}${ZEXTENSION}; \ - rm -f $${t}; \ + rm -f $${t} $${t}${ZEXTENSION}; \ ln $${l}${ZEXT} $${t}${ZEXT}; \ done; true .endif |