diff --git a/share/mk/bsd.README b/share/mk/bsd.README index ce340d3cead0..031d470e16a5 100644 --- a/share/mk/bsd.README +++ b/share/mk/bsd.README @@ -90,10 +90,14 @@ environment or otherwise. You probably don't want to touch this file. The include file handles installing manual pages and their links. -It has a single target: +It has three targets: + all-man: + build manual pages. maninstall: - Install the manual pages and their links. + install the manual pages and their links. + manlint: + verify the validity of manual pages. It sets/uses the following variables: diff --git a/share/mk/bsd.man.mk b/share/mk/bsd.man.mk index 7695d729e195..8911aa442e8f 100644 --- a/share/mk/bsd.man.mk +++ b/share/mk/bsd.man.mk @@ -227,3 +227,16 @@ maninstall:: ${MAN} done .endif .endif + +manlint: +.if defined(MAN) && !empty(MAN) +.for page in ${MAN} +manlint: ${page}lint +${page}lint: ${page} +.if defined(MANFILTER) + ${MANFILTER} < ${.ALLSRC} | ${MROFF_CMD} -ww >/dev/null +.else + ${MROFF_CMD} -ww ${.ALLSRC} >/dev/null +.endif +.endfor +.endif