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