aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile35
1 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 06c2e6f..66c733d 100644
--- a/Makefile
+++ b/Makefile
@@ -21,3 +21,38 @@ AUTO_CI_HIPE ?= OTP-LATEST
AUTO_CI_WINDOWS ?= OTP-19+
include erlang.mk
+
+# Test building documentation of projects that use Asciideck
+# and run Groff checks against the output.
+#
+# We only run against asciidoc-manual because the guide requires
+# the DocBook toolchain at this time.
+
+.PHONY: groff
+
+GROFF_PROJECTS = cowboy gun ranch
+
+tests:: groff
+
+groff: $(addprefix groff-,$(GROFF_PROJECTS))
+
+$(ERLANG_MK_TMP)/groff:
+ $(verbose) mkdir -p $@
+
+define groff_targets
+$(ERLANG_MK_TMP)/groff/$1: | $(ERLANG_MK_TMP)/groff
+ $(verbose) rm -rf $$@
+ $(verbose) git clone -q --depth 1 -- $(call dep_repo,$1) $$@
+ $(verbose) mkdir $$@/deps
+ $(verbose) ln -s $(CURDIR) $$@/deps/asciideck
+ $(verbose) cp $(CURDIR)/erlang.mk $$@/
+
+groff-$1: $(ERLANG_MK_TMP)/groff/$1
+ $(gen_verbose) $(MAKE) -C $$^ asciidoc-manual
+ $(verbose) for f in $$^/doc/man*/*.gz; do \
+ echo " GROFF " `basename "$$$$f"`; \
+ zcat "$$$$f" | groff -man -rD1 -z -ww; \
+ done
+endef
+
+$(foreach p,$(GROFF_PROJECTS),$(eval $(call groff_targets,$p)))