[BACK]Return to bsd.man.mk CVS log [TXT][DIR] Up to [local] / src / share / mk

Annotation of src/share/mk/bsd.man.mk, Revision 1.34

1.34    ! naddy       1: #      $OpenBSD: bsd.man.mk,v 1.33 2011/06/23 22:46:12 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.18      espie      13: .if defined(MANSUBDIR)
                     14: # Add / so that we don't have to specify it. Better arch -> MANSUBDIR mapping
                     15: MANSUBDIR:=${MANSUBDIR:S,^,/,}
                     16: .else
                     17: # XXX MANSUBDIR must be non empty for the mlink loops to work
                     18: MANSUBDIR=''
                     19: .endif
                     20:
1.34    ! naddy      21: CLEANFILES+= .man-linted
        !            22:
1.33      schwarze   23: .if defined(MAN) && !empty(MAN)
1.34    ! naddy      24: .man-linted: ${MAN}
1.33      schwarze   25:        mandoc -Tlint -Wfatal ${.ALLSRC}
1.34    ! naddy      26:        @touch ${.TARGET}
        !            27:
        !            28: all: .man-linted
1.25      espie      29: .endif
                     30:
1.33      schwarze   31: .for page in ${MAN}
                     32: .  for sub in ${MANSUBDIR}
                     33: ${DESTDIR}${MANDIR}${page:E}${sub}/${page:T}: ${page}
                     34:        ${INSTALL} ${INSTALL_COPY} -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} \
                     35:                ${.ALLSRC} ${.TARGET}
                     36:
                     37: maninstall: ${DESTDIR}${MANDIR}${page:E}${sub}/${page:T}
                     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.33      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}