docs: Add Makefile rule to check syntax of manpages.
[sliver-openvswitch.git] / Makefile.am
index 91218e1..2090501 100644 (file)
@@ -45,7 +45,8 @@ EXTRA_DIST = \
        REPORTING-BUGS \
        SubmittingPatches \
        WHY-OVS \
-       boot.sh
+       boot.sh \
+       $(MAN_FRAGMENTS)
 bin_PROGRAMS =
 sbin_PROGRAMS =
 bin_SCRIPTS =
@@ -57,6 +58,7 @@ dist_sbin_SCRIPTS =
 dist_scripts_SCRIPTS =
 INSTALL_DATA_LOCAL =
 man_MANS =
+MAN_FRAGMENTS =
 noinst_DATA =
 noinst_HEADERS =
 noinst_LIBRARIES =
@@ -148,6 +150,17 @@ rate-limit-check:
            exit 1; \
         fi
 
+if HAVE_GROFF
+ALL_LOCAL += manpage-check
+manpage-check: $(MANS) $(MAN_FRAGMENTS)
+       @manpages=; \
+       for d in $(MANS); do \
+               manpages="$$manpages `test -f $$d || echo $(VPATH)/`$$d"; \
+       done; \
+       LANG=en_US.UTF-8 groff -w mac -w delim -w escape -w input -w missing -w tab -T utf8 -man -p -z $$manpages && touch $@
+CLEANFILES += manpage-check
+endif
+
 dist-hook: $(DIST_HOOKS)
 all-local: $(ALL_LOCAL)
 clean-local: $(CLEAN_LOCAL)