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