bsd.man.mk: add temporary ``mandiff'' target
authorFranco Fichtner <franco@lastsummer.de>
Mon, 7 Oct 2013 20:16:43 +0000 (22:16 +0200)
committerFranco Fichtner <franco@lastsummer.de>
Mon, 7 Oct 2013 20:35:34 +0000 (22:35 +0200)
Show differences in ASCII output between groff(1) and mandoc(1).  This
will help generate uptream bug reports.  Also useful for spotting local
configuration quirks of both programs.

Makefile
share/mk/bsd.man.mk
share/mk/bsd.subdir.mk

index da4cde8..14ad9a5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -86,6 +86,7 @@ TGTS= all all-man buildkernel quickkernel nativekernel \
        backup-clean backup-auto-clean \
        _obj _includes _libraries _depend _worldtmp \
        _bootstrap-tools _build-tools _cross-tools
+TGTS+= mandiff # XXX temporary target
 
 BITGTS=        files includes
 BITGTS:=${BITGTS} ${BITGTS:S/^/build/} ${BITGTS:S/^/install/}
index 7cbf50f..beb1d9f 100644 (file)
@@ -240,9 +240,11 @@ _maninstall: ${MAN}
 .endif
 
 manlint:
+mandiff:
 .if defined(MAN) && !empty(MAN)
 .for page in ${MAN}
 manlint: ${page}lint
+mandiff: ${page}diff
 ${page}lint: ${page}
 .if defined(MANFILTER)
        @${MANFILTER} < ${.ALLSRC} | ${MROFF_CMD} -ww -z
@@ -251,5 +253,12 @@ ${page}lint: ${page}
        @${MROFF_CMD} -ww -z ${.ALLSRC}
        @-mandoc -Tlint ${.ALLSRC}
 .endif
+${page}.out.groff: ${page}
+       @-groff -mandoc -Tascii -P -c ${.ALLSRC} 2>&1 > ${.TARGET}
+${page}.out.mandoc: ${page}
+       @-mandoc -Werror ${.ALLSRC} 2>&1 > ${.TARGET}
+${page}diff: ${page}.out.groff ${page}.out.mandoc
+       @-diff -au ${.ALLSRC}
+       @rm ${.ALLSRC}
 .endfor
 .endif
index 14c1661..2dd717a 100644 (file)
@@ -38,6 +38,7 @@ __targets= \
        maninstall realinstall  \
        lint manlint regress \
        buildfiles buildincludes installfiles installincludes
+__targets+=    mandiff # XXX temporary target
 
 .for __target in ${__targets}