blob: 27db2cd6e719eff7b3de1ebe1c4ede9a5c81e38f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
# $OpenBSD: bsd.man.mk,v 1.34 2011/06/24 14:17:41 naddy Exp $
# $NetBSD: bsd.man.mk,v 1.23 1996/02/10 07:49:33 jtc Exp $
# @(#)bsd.man.mk 5.2 (Berkeley) 5/11/90
.if !target(.MAIN)
. if exists(${.CURDIR}/../Makefile.inc)
. include "${.CURDIR}/../Makefile.inc"
. endif
.MAIN: all
.endif
.if defined(MANSUBDIR)
# Add / so that we don't have to specify it. Better arch -> MANSUBDIR mapping
MANSUBDIR:=${MANSUBDIR:S,^,/,}
.else
# XXX MANSUBDIR must be non empty for the mlink loops to work
MANSUBDIR=''
.endif
CLEANFILES+= .man-linted
.if defined(MAN) && !empty(MAN)
.man-linted: ${MAN}
mandoc -Tlint -Wfatal ${.ALLSRC}
@touch ${.TARGET}
all: .man-linted
.endif
.for page in ${MAN}
. for sub in ${MANSUBDIR}
${DESTDIR}${MANDIR}${page:E}${sub}/${page:T}: ${page}
${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
${.ALLSRC} ${.TARGET}
maninstall: ${DESTDIR}${MANDIR}${page:E}${sub}/${page:T}
. endfor
.endfor
maninstall:
.if defined(MLINKS) && !empty(MLINKS)
. for sub in ${MANSUBDIR}
. for lnk file in ${MLINKS}
@l=${DESTDIR}${MANDIR}${lnk:E}${sub}/${lnk}; \
t=${DESTDIR}${MANDIR}${file:E}${sub}/${file}; \
echo $$t -\> $$l; \
rm -f $$t; ln $$l $$t;
. endfor
. endfor
.endif
BEFOREMAN?=
all: ${BEFOREMAN} ${MAN}
|