version 1.40, 2014/03/08 17:08:11 |
version 1.41, 2015/01/16 01:58:17 |
|
|
.endif |
.endif |
|
|
BEFOREMAN?= |
BEFOREMAN?= |
MANLINT=${MAN:S/$/.manlint/} |
|
CLEANFILES+=.man-linted ${MANLINT} |
|
|
|
# Add / so that we don't have to specify it. |
# Add / so that we don't have to specify it. |
.if defined(MANSUBDIR) && !empty(MANSUBDIR) |
.if defined(MANSUBDIR) && !empty(MANSUBDIR) |
|
|
.endif |
.endif |
|
|
# Files contained in ${BEFOREMAN} must be built before generating any |
# Files contained in ${BEFOREMAN} must be built before generating any |
# manual page source code. However, static manual page files contained |
# manual page source code. |
# in the source tree must not appear as targets, or the ${.IMPSRC} in |
|
# the .man.manlint suffix rule below will not find them in the .PATH. |
|
.for page in ${MAN} |
.for page in ${MAN} |
. if target(${page}) |
. if target(${page}) |
${page}: ${BEFOREMAN} |
${page}: ${BEFOREMAN} |
. endif |
. endif |
.endfor |
.endfor |
|
|
# In any case, ${BEFOREMAN} must be finished before linting any manuals. |
|
.if !empty(MANLINT) |
|
${MANLINT}: ${BEFOREMAN} |
|
.endif |
|
|
|
# Set up the suffix rules for checking manuals. |
|
_MAN_SUFFIXES=1 2 3 3p 4 5 6 7 8 9 |
|
.for s in ${_MAN_SUFFIXES} |
|
.SUFFIXES: .${s} .${s}.manlint |
|
.${s}.${s}.manlint: |
|
.if ${WARNINGS:L} == "yes" |
|
@echo "mandoc -Tlint ${.IMPSRC}" |
|
@mandoc -Tlint ${.IMPSRC} || [ $$? -lt 4 ] |
|
.else |
|
mandoc -Tlint -Wfatal ${.IMPSRC} |
|
.endif |
|
@touch ${.TARGET} |
|
.endfor |
|
|
|
# Install the real manuals. |
# Install the real manuals. |
.for page in ${MAN} |
.for page in ${MAN} |
. for sub in ${MANSUBDIR} |
. for sub in ${MANSUBDIR} |
|
|
.endif |
.endif |
|
|
# Explicitly list ${BEFOREMAN} to get it done even if ${MAN} is empty. |
# Explicitly list ${BEFOREMAN} to get it done even if ${MAN} is empty. |
all: ${BEFOREMAN} ${MAN} ${MANLINT} |
all: ${BEFOREMAN} ${MAN} |
|
|
|
manlint: ${MAN} |
|
.if defined(MAN) && !empty(MAN) |
|
mandoc -Tlint ${.ALLSRC} |
|
.endif |
|
|
|
.PHONY: manlint |