bsd.man.mk revision 1.12 1 # from: @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
2 # $Id: bsd.man.mk,v 1.12 1994/01/31 18:40:13 jtc 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 .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 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}1${MANSUBDIR}
27 ${MINSTALL} ${MAN1} ${DESTDIR}${MANDIR}1${MANSUBDIR}
28 .endif
29 .if defined(MAN2) && !empty(MAN2)
30 MANALL+=${MAN2}
31 maninstall: man2install
32 man2install:
33 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}2${MANSUBDIR}
34 ${MINSTALL} ${MAN2} ${DESTDIR}${MANDIR}2${MANSUBDIR}
35 .endif
36 .if defined(MAN3) && !empty(MAN3)
37 MANALL+=${MAN3}
38 maninstall: man3install
39 man3install:
40 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}3${MANSUBDIR}
41 ${MINSTALL} ${MAN3} ${DESTDIR}${MANDIR}3${MANSUBDIR}
42 .endif
43 .if defined(MAN3F) && !empty(MAN3F)
44 MANALL+=${MAN3F}
45 maninstall: man3finstall
46 man3finstall:
47 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}3f${MANSUBDIR}
48 ${MINSTALL} ${MAN3F} ${DESTDIR}${MANDIR}3f${MANSUBDIR}
49 .endif
50 .if defined(MAN4) && !empty(MAN4)
51 MANALL+=${MAN4}
52 maninstall: man4install
53 man4install:
54 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}4${MANSUBDIR}
55 ${MINSTALL} ${MAN4} ${DESTDIR}${MANDIR}4${MANSUBDIR}
56 .endif
57 .if defined(MAN5) && !empty(MAN5)
58 MANALL+=${MAN5}
59 maninstall: man5install
60 man5install:
61 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}5${MANSUBDIR}
62 ${MINSTALL} ${MAN5} ${DESTDIR}${MANDIR}5${MANSUBDIR}
63 .endif
64 .if defined(MAN6) && !empty(MAN6)
65 MANALL+=${MAN6}
66 maninstall: man6install
67 man6install:
68 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}6${MANSUBDIR}
69 ${MINSTALL} ${MAN6} ${DESTDIR}${MANDIR}6${MANSUBDIR}
70 .endif
71 .if defined(MAN7) && !empty(MAN7)
72 MANALL+=${MAN7}
73 maninstall: man7install
74 man7install:
75 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}7${MANSUBDIR}
76 ${MINSTALL} ${MAN7} ${DESTDIR}${MANDIR}7${MANSUBDIR}
77 .endif
78 .if defined(MAN8) && !empty(MAN8)
79 MANALL+=${MAN8}
80 maninstall: man8install
81 man8install:
82 @install -d -o root -g wheel -m 755 ${DESTDIR}${MANDIR}8${MANSUBDIR}
83 ${MINSTALL} ${MAN8} ${DESTDIR}${MANDIR}8${MANSUBDIR}
84 .endif
85 .if defined(MLINKS) && !empty(MLINKS)
86 maninstall: manlinkinstall
87 manlinkinstall:
88 @set ${MLINKS}; \
89 while test $$# -ge 2; do \
90 name=$$1; \
91 shift; \
92 dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
93 l=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0; \
94 name=$$1; \
95 shift; \
96 dir=${DESTDIR}${MANDIR}`expr $$name : '.*\.\(.*\)'`; \
97 t=$${dir}${MANSUBDIR}/`expr $$name : '\(.*\)\..*'`.0; \
98 echo $$t -\> $$l; \
99 rm -f $$t; \
100 ln $$l $$t; \
101 done; true
102 .endif
103
104 .if defined(MANALL)
105 all: ${MANALL}
106
107 cleandir: cleanman
108 cleanman:
109 rm -f ${MANALL}
110 .endif
111