Annotation of src/share/mk/bsd.man.mk, Revision 1.36
1.36 ! schwarze 1: # $OpenBSD: bsd.man.mk,v 1.35 2011/06/28 23:50:46 schwarze 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.36 ! schwarze 20: CLEANFILES+=.man-linted *.manlint
1.34 naddy 21:
1.36 ! schwarze 22: .for page in ${MAN}
! 23: ${page}.manlint: ${page}
1.33 schwarze 24: mandoc -Tlint -Wfatal ${.ALLSRC}
1.34 naddy 25: @touch ${.TARGET}
26:
1.36 ! schwarze 27: all: ${page}.manlint
1.25 espie 28:
1.33 schwarze 29: . for sub in ${MANSUBDIR}
1.35 schwarze 30: _MAN_INST=${DESTDIR}${MANDIR}${page:E}${sub}${page:T}
31: ${_MAN_INST}: ${page}
1.33 schwarze 32: ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
33: ${.ALLSRC} ${.TARGET}
34:
1.35 schwarze 35: maninstall: ${_MAN_INST}
1.33 schwarze 36: . endfor
1.25 espie 37: .endfor
38:
1.33 schwarze 39: maninstall:
1.1 deraadt 40: .if defined(MLINKS) && !empty(MLINKS)
1.23 espie 41: . for sub in ${MANSUBDIR}
42: . for lnk file in ${MLINKS}
1.35 schwarze 43: @l=${DESTDIR}${MANDIR}${lnk:E}${sub}${lnk}; \
44: t=${DESTDIR}${MANDIR}${file:E}${sub}${file}; \
1.23 espie 45: echo $$t -\> $$l; \
46: rm -f $$t; ln $$l $$t;
47: . endfor
1.18 espie 48: . endfor
1.1 deraadt 49: .endif
50:
1.29 espie 51: BEFOREMAN?=
1.34 naddy 52: all: ${BEFOREMAN} ${MAN}