Home | History | Annotate | Line # | Download | only in mk
bsd.man.mk revision 1.10
      1 #	from: @(#)bsd.man.mk	5.2 (Berkeley) 5/11/90
      2 #	$Id: bsd.man.mk,v 1.10 1993/08/15 21:27:26 mycroft Exp $
      3 
      4 .if !target(.MAIN)
      5 .if exists(${.CURDIR}/../Makefile.inc)
      6 .include "${.CURDIR}/../Makefile.inc"
      7 .endif
      8 
      9 .MAIN: all
     10 .endif
     11 
     12 MINSTALL=	install ${COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE}
     13 
     14 maninstall:
     15 .if defined(MAN1) && !empty(MAN1)
     16 MANALL+=${MAN1}
     17 maninstall: man1install
     18 man1install:
     19 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}1${MANSUBDIR}
     20 	${MINSTALL} ${MAN1} ${DESTDIR}${MANDIR}1${MANSUBDIR}
     21 .endif
     22 .if defined(MAN2) && !empty(MAN2)
     23 MANALL+=${MAN2}
     24 maninstall: man2install
     25 man2install:
     26 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}2${MANSUBDIR}
     27 	${MINSTALL} ${MAN2} ${DESTDIR}${MANDIR}2${MANSUBDIR}
     28 .endif
     29 .if defined(MAN3) && !empty(MAN3)
     30 MANALL+=${MAN3}
     31 maninstall: man3install
     32 man3install:
     33 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}3${MANSUBDIR}
     34 	${MINSTALL} ${MAN3} ${DESTDIR}${MANDIR}3${MANSUBDIR}
     35 .endif
     36 .if defined(MAN3F) && !empty(MAN3F)
     37 MANALL+=${MAN3F}
     38 maninstall: man3finstall
     39 man3finstall:
     40 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}3f${MANSUBDIR}
     41 	${MINSTALL} ${MAN3F} ${DESTDIR}${MANDIR}3f${MANSUBDIR}
     42 .endif
     43 .if defined(MAN4) && !empty(MAN4)
     44 MANALL+=${MAN4}
     45 maninstall: man4install
     46 man4install:
     47 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}4${MANSUBDIR}
     48 	${MINSTALL} ${MAN4} ${DESTDIR}${MANDIR}4${MANSUBDIR}
     49 .endif
     50 .if defined(MAN5) && !empty(MAN5)
     51 MANALL+=${MAN5}
     52 maninstall: man5install
     53 man5install:
     54 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}5${MANSUBDIR}
     55 	${MINSTALL} ${MAN5} ${DESTDIR}${MANDIR}5${MANSUBDIR}
     56 .endif
     57 .if defined(MAN6) && !empty(MAN6)
     58 MANALL+=${MAN6}
     59 maninstall: man6install
     60 man6install:
     61 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}6${MANSUBDIR}
     62 	${MINSTALL} ${MAN6} ${DESTDIR}${MANDIR}6${MANSUBDIR}
     63 .endif
     64 .if defined(MAN7) && !empty(MAN7)
     65 MANALL+=${MAN7}
     66 maninstall: man7install
     67 man7install:
     68 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}7${MANSUBDIR}
     69 	${MINSTALL} ${MAN7} ${DESTDIR}${MANDIR}7${MANSUBDIR}
     70 .endif
     71 .if defined(MAN8) && !empty(MAN8)
     72 MANALL+=${MAN8}
     73 maninstall: man8install
     74 man8install:
     75 	@install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}8${MANSUBDIR}
     76 	${MINSTALL} ${MAN8} ${DESTDIR}${MANDIR}8${MANSUBDIR}
     77 .endif
     78 .if defined(MLINKS) && !empty(MLINKS)
     79 maninstall: manlinkinstall
     80 manlinkinstall:
     81 	@set ${MLINKS}; \
     82 	while test $$# -ge 2; do \
     83 		name=$$1; \
     84 		shift; \
     85 		dir=${DESTDIR}${MANDIR}`expr $$name : '[^\.]*\.\(.*\)'`; \
     86 		l=$${dir}${MANSUBDIR}/`expr $$name : '\([^\.]*\)'`.0; \
     87 		name=$$1; \
     88 		shift; \
     89 		dir=${DESTDIR}${MANDIR}`expr $$name : '[^\.]*\.\(.*\)'`; \
     90 		t=$${dir}${MANSUBDIR}/`expr $$name : '\([^\.]*\)'`.0; \
     91 		echo $$t -\> $$l; \
     92 		rm -f $$t; \
     93 		ln $$l $$t; \
     94 	done; true
     95 .endif
     96 
     97 .if defined(MANALL)
     98 all: ${MANALL}
     99 
    100 cleandir: cleanman
    101 cleanman:
    102 	rm -f ${MANALL}
    103 .endif
    104