]> Sergey Matveev's repositories - public-inbox.git/blobdiff - Documentation/include.mk
doc: enable "check-man" target via "check" in gmake
[public-inbox.git] / Documentation / include.mk
index 45e085738ea6c01708a628f796d805e5c3a4f460..1460604d092fa9fd8401318900840b60ad174e50 100644 (file)
@@ -61,7 +61,9 @@ man8 := $(addsuffix .8, $(m8))
 
 all:: man html
 
-man: $(man1) $(man5) $(man7) $(man8)
+manpages = $(man1) $(man5) $(man7) $(man8)
+
+man: $(manpages)
 
 prefix ?= $(PREFIX)
 prefix ?= $(HOME)
@@ -86,6 +88,17 @@ doc_install :: install-man
 %.1 %.5 %.7 %.8 : Documentation/%.pod
        $(podman) -s $(subst .,,$(suffix $@)) $< $@+ && mv $@+ $@
 
+check :: check-man
+check_man = @echo CHECK80 $<;COLUMNS=80 $(MAN) ./$^ | \
+       $(AWK) '{gsub(/\b./,"")}length>80{print;err=1}END{exit(err)}' >&2
+
+%.1.cols : %.1; $(check_man)
+%.5.cols : %.5; $(check_man)
+%.7.cols : %.7; $(check_man)
+%.8.cols : %.8; $(check_man)
+
+check-man :: $(addsuffix .cols, $(manpages))
+
 manuals :=
 manuals += $(m1)
 manuals += $(m5)