From abe4ff5ca5c6c74c4c1562c38d74ab232607312b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 16 Aug 2018 15:54:16 +0200 Subject: Run groff against projects that use Asciideck for their manual --- Makefile | 35 +++++++++++++++++++++++++++++++++++ erlang.mk | 32 +++++++++++++++++++------------- 2 files changed, 54 insertions(+), 13 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))) diff --git a/erlang.mk b/erlang.mk index 86be4cb..6e67382 100644 --- a/erlang.mk +++ b/erlang.mk @@ -17,7 +17,7 @@ ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST))) export ERLANG_MK_FILENAME -ERLANG_MK_VERSION = 208a116 +ERLANG_MK_VERSION = 2018.06.21-6-g6c8664c-dirty ERLANG_MK_WITHOUT = # Make 3.81 and 3.82 are deprecated. @@ -256,9 +256,8 @@ distclean-kerl: # Allow users to select which version of Erlang/OTP to use for a project. ifneq ($(strip $(LATEST_ERLANG_OTP)),) -ERLANG_OTP := $(notdir $(lastword $(sort \ - $(filter-out $(KERL_INSTALL_DIR)/OTP_% %-rc1 %-rc2 %-rc3,\ - $(wildcard $(KERL_INSTALL_DIR)/*[^-native]))))) +ERLANG_OTP := $(notdir $(lastword $(sort $(filter-out $(KERL_INSTALL_DIR)/OTP_R%,\ + $(filter-out %-rc1 %-rc2 %-rc3,$(wildcard $(KERL_INSTALL_DIR)/*[^-native])))))) endif ERLANG_OTP ?= @@ -415,9 +414,9 @@ pkg_basho_bench_commit = master PACKAGES += bcrypt pkg_bcrypt_name = bcrypt pkg_bcrypt_description = Bcrypt Erlang / C library -pkg_bcrypt_homepage = https://github.com/riverrun/branglecrypt +pkg_bcrypt_homepage = https://github.com/erlangpack/bcrypt pkg_bcrypt_fetch = git -pkg_bcrypt_repo = https://github.com/riverrun/branglecrypt +pkg_bcrypt_repo = https://github.com/erlangpack/bcrypt.git pkg_bcrypt_commit = master PACKAGES += beam @@ -4296,7 +4295,7 @@ export NO_AUTOPATCH # Verbosity. -dep_verbose_0 = @echo " DEP $1 ($(call dep_commit,$1))"; +dep_verbose_0 = @echo " DEP $1 ($(call dep_commit,$1))"; dep_verbose_2 = set -x; dep_verbose = $(dep_verbose_$(V)) @@ -5273,7 +5272,7 @@ ifneq ($(SKIP_DEPS),) doc-deps: else doc-deps: $(ALL_DOC_DEPS_DIRS) - $(verbose) set -e; for dep in $(ALL_DOC_DEPS_DIRS) ; do $(MAKE) -C $$dep; done + $(verbose) set -e; for dep in $(ALL_DOC_DEPS_DIRS) ; do $(MAKE) -C $$dep IS_DEP=1; done endif # Copyright (c) 2015-2016, Loïc Hoguin @@ -5455,8 +5454,8 @@ endef asciidoc-manual:: doc-deps asciidoc-manual:: $(ASCIIDOC_MANUAL_FILES) - $(call erlang,$(call asciidoc2man.erl,$?)) - $(foreach s,$(MAN_SECTIONS),mkdir -p doc/man$s/ && mv doc/src/manual/*.$s.gz doc/man$s/;) + $(gen_verbose) $(call erlang,$(call asciidoc2man.erl,$?)) + $(verbose) $(foreach s,$(MAN_SECTIONS),mkdir -p doc/man$s/ && mv doc/src/manual/*.$s.gz doc/man$s/;) install-docs:: install-asciidoc @@ -6243,7 +6242,7 @@ ci_verbose = $(ci_verbose_$(V)) define ci_target ci-$1: $(KERL_INSTALL_DIR)/$2 - $(verbose) $(MAKE) --no-print-directory clean + $(verbose) $(MAKE) --no-print-directory clean distclean-c_src-env $(ci_verbose) \ PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \ CI_OTP_RELEASE="$1" \ @@ -6402,7 +6401,7 @@ $(DIALYZER_PLT): deps app $(eval DEPS_LOG := $(shell test -f $(ERLANG_MK_TMP)/deps.log && \ while read p; do test -d $$p/ebin && echo $$p/ebin; done <$(ERLANG_MK_TMP)/deps.log)) $(verbose) dialyzer --build_plt $(DIALYZER_PLT_OPTS) --apps \ - erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG) + erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG) || test $$? -eq 2 plt: $(DIALYZER_PLT) @@ -6708,7 +6707,7 @@ endif RELX ?= $(ERLANG_MK_TMP)/relx RELX_CONFIG ?= $(CURDIR)/relx.config -RELX_URL ?= https://erlang.mk/res/relx-v3.24.5 +RELX_URL ?= https://erlang.mk/res/relx-v3.26.0 RELX_OPTS ?= RELX_OUTPUT_DIR ?= _rel RELX_REL_EXT ?= @@ -6782,6 +6781,13 @@ endif run:: all $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console +ifdef RELOAD +rel:: + $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) ping + $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) \ + eval "io:format(\"~p~n\", [c:lm()])" +endif + help:: $(verbose) printf "%s\n" "" \ "Relx targets:" \ -- cgit v1.2.3