Makefile: check manpages for syntax errors

Pass the same parameters Lintian uses in Debian.

$ make check
<...>
Checking manpages for syntax errors...
<standard input>:48: warning: macro `Q' not defined
Error in tc-taprio.8
Makefile:27: recipe for target 'check' failed

Signed-off-by: Luca Boccassi <bluca@debian.org>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
Luca Boccassi 2019-01-12 12:28:56 +00:00 committed by Stephen Hemminger
parent 8242808ced
commit 0cf061183e
5 changed files with 28 additions and 5 deletions

View File

@ -115,6 +115,12 @@ distclean: clobber
check: all
cd testsuite && $(MAKE) && $(MAKE) alltests
@if command -v man >/dev/null 2>&1; then \
echo "Checking manpages for syntax errors..."; \
$(MAKE) -C man check; \
else \
echo "man not installed, skipping checks for syntax errors."; \
fi
cscope:
cscope -b -q -R -Iinclude -sip -slib -smisc -snetem -stc

View File

@ -2,14 +2,19 @@
INSTALL=install
INSTALLDIR=install -m 0755 -d
INSTALLMAN=install -m 0644
# Pass the same parameters as Lintian uses on Debian.
MAN_CHECK=LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 man --warnings \
--encoding=UTF-8 --local-file --troff-device=utf8 --ditroff
# Hide man output, count and print errors.
MAN_REDIRECT=2>&1 >/dev/null | tee /dev/fd/2 | wc -l
SUBDIRS = man3 man7 man8
all clean install:
all clean install check:
@for subdir in $(SUBDIRS); do $(MAKE) -C $$subdir $@ || exit $$?; done
distclean: clean
.PHONY: install clean distclean
.PHONY: install clean distclean check
.EXPORT_ALL_VARIABLES:

View File

@ -11,4 +11,8 @@ install:
$(INSTALLDIR) $(DESTDIR)$(MANDIR)/man3
$(INSTALLMAN) $(MAN3PAGES) $(DESTDIR)$(MANDIR)/man3
.PHONY: install clean distclean
check:
@for page in $(MAN3PAGES); do test 0 -eq $$($(MAN_CHECK) $$page \
$(MAN_REDIRECT)) || { echo "Error in $$page"; exit 1; }; done
.PHONY: install clean distclean check

View File

@ -11,4 +11,8 @@ install:
$(INSTALLDIR) $(DESTDIR)$(MANDIR)/man7
$(INSTALLMAN) $(MAN7PAGES) $(DESTDIR)$(MANDIR)/man7
.PHONY: install clean distclean
check:
@for page in $(MAN7PAGES); do test 0 -eq $$($(MAN_CHECK) $$page \
$(MAN_REDIRECT)) || { echo "Error in $$page"; exit 1; }; done
.PHONY: install clean distclean check

View File

@ -23,4 +23,8 @@ install:
$(INSTALLDIR) $(DESTDIR)$(MANDIR)/man8
$(INSTALLMAN) $(MAN8PAGES) $(DESTDIR)$(MANDIR)/man8
.PHONY: install clean distclean
check: all
@for page in $(MAN8PAGES); do test 0 -eq $$($(MAN_CHECK) $$page \
$(MAN_REDIRECT)) || { echo "Error in $$page"; exit 1; }; done
.PHONY: install clean distclean check