Codebase list erlang-asciideck / abe4ff5
Run groff against projects that use Asciideck for their manual Loïc Hoguin 5 years ago
2 changed file(s) with 54 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
2020 AUTO_CI_WINDOWS ?= OTP-19+
2121
2222 include erlang.mk
23
24 # Test building documentation of projects that use Asciideck
25 # and run Groff checks against the output.
26 #
27 # We only run against asciidoc-manual because the guide requires
28 # the DocBook toolchain at this time.
29
30 .PHONY: groff
31
32 GROFF_PROJECTS = cowboy gun ranch
33
34 tests:: groff
35
36 groff: $(addprefix groff-,$(GROFF_PROJECTS))
37
38 $(ERLANG_MK_TMP)/groff:
39 $(verbose) mkdir -p $@
40
41 define groff_targets
42 $(ERLANG_MK_TMP)/groff/$1: | $(ERLANG_MK_TMP)/groff
43 $(verbose) rm -rf $$@
44 $(verbose) git clone -q --depth 1 -- $(call dep_repo,$1) $$@
45 $(verbose) mkdir $$@/deps
46 $(verbose) ln -s $(CURDIR) $$@/deps/asciideck
47 $(verbose) cp $(CURDIR)/erlang.mk $$@/
48
49 groff-$1: $(ERLANG_MK_TMP)/groff/$1
50 $(gen_verbose) $(MAKE) -C $$^ asciidoc-manual
51 $(verbose) for f in $$^/doc/man*/*.gz; do \
52 echo " GROFF " `basename "$$$$f"`; \
53 zcat "$$$$f" | groff -man -rD1 -z -ww; \
54 done
55 endef
56
57 $(foreach p,$(GROFF_PROJECTS),$(eval $(call groff_targets,$p)))
1616 ERLANG_MK_FILENAME := $(realpath $(lastword $(MAKEFILE_LIST)))
1717 export ERLANG_MK_FILENAME
1818
19 ERLANG_MK_VERSION = 208a116
19 ERLANG_MK_VERSION = 2018.06.21-6-g6c8664c-dirty
2020 ERLANG_MK_WITHOUT =
2121
2222 # Make 3.81 and 3.82 are deprecated.
255255 # Allow users to select which version of Erlang/OTP to use for a project.
256256
257257 ifneq ($(strip $(LATEST_ERLANG_OTP)),)
258 ERLANG_OTP := $(notdir $(lastword $(sort \
259 $(filter-out $(KERL_INSTALL_DIR)/OTP_% %-rc1 %-rc2 %-rc3,\
260 $(wildcard $(KERL_INSTALL_DIR)/*[^-native])))))
258 ERLANG_OTP := $(notdir $(lastword $(sort $(filter-out $(KERL_INSTALL_DIR)/OTP_R%,\
259 $(filter-out %-rc1 %-rc2 %-rc3,$(wildcard $(KERL_INSTALL_DIR)/*[^-native]))))))
261260 endif
262261
263262 ERLANG_OTP ?=
414413 PACKAGES += bcrypt
415414 pkg_bcrypt_name = bcrypt
416415 pkg_bcrypt_description = Bcrypt Erlang / C library
417 pkg_bcrypt_homepage = https://github.com/riverrun/branglecrypt
416 pkg_bcrypt_homepage = https://github.com/erlangpack/bcrypt
418417 pkg_bcrypt_fetch = git
419 pkg_bcrypt_repo = https://github.com/riverrun/branglecrypt
418 pkg_bcrypt_repo = https://github.com/erlangpack/bcrypt.git
420419 pkg_bcrypt_commit = master
421420
422421 PACKAGES += beam
42954294
42964295 # Verbosity.
42974296
4298 dep_verbose_0 = @echo " DEP $1 ($(call dep_commit,$1))";
4297 dep_verbose_0 = @echo " DEP $1 ($(call dep_commit,$1))";
42994298 dep_verbose_2 = set -x;
43004299 dep_verbose = $(dep_verbose_$(V))
43014300
52725271 doc-deps:
52735272 else
52745273 doc-deps: $(ALL_DOC_DEPS_DIRS)
5275 $(verbose) set -e; for dep in $(ALL_DOC_DEPS_DIRS) ; do $(MAKE) -C $$dep; done
5274 $(verbose) set -e; for dep in $(ALL_DOC_DEPS_DIRS) ; do $(MAKE) -C $$dep IS_DEP=1; done
52765275 endif
52775276
52785277 # Copyright (c) 2015-2016, Loïc Hoguin <essen@ninenines.eu>
54545453 asciidoc-manual:: doc-deps
54555454
54565455 asciidoc-manual:: $(ASCIIDOC_MANUAL_FILES)
5457 $(call erlang,$(call asciidoc2man.erl,$?))
5458 $(foreach s,$(MAN_SECTIONS),mkdir -p doc/man$s/ && mv doc/src/manual/*.$s.gz doc/man$s/;)
5456 $(gen_verbose) $(call erlang,$(call asciidoc2man.erl,$?))
5457 $(verbose) $(foreach s,$(MAN_SECTIONS),mkdir -p doc/man$s/ && mv doc/src/manual/*.$s.gz doc/man$s/;)
54595458
54605459 install-docs:: install-asciidoc
54615460
62426241
62436242 define ci_target
62446243 ci-$1: $(KERL_INSTALL_DIR)/$2
6245 $(verbose) $(MAKE) --no-print-directory clean
6244 $(verbose) $(MAKE) --no-print-directory clean distclean-c_src-env
62466245 $(ci_verbose) \
62476246 PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \
62486247 CI_OTP_RELEASE="$1" \
64016400 $(eval DEPS_LOG := $(shell test -f $(ERLANG_MK_TMP)/deps.log && \
64026401 while read p; do test -d $$p/ebin && echo $$p/ebin; done <$(ERLANG_MK_TMP)/deps.log))
64036402 $(verbose) dialyzer --build_plt $(DIALYZER_PLT_OPTS) --apps \
6404 erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG)
6403 erts kernel stdlib $(PLT_APPS) $(OTP_DEPS) $(LOCAL_DEPS) $(DEPS_LOG) || test $$? -eq 2
64056404
64066405 plt: $(DIALYZER_PLT)
64076406
67076706 RELX ?= $(ERLANG_MK_TMP)/relx
67086707 RELX_CONFIG ?= $(CURDIR)/relx.config
67096708
6710 RELX_URL ?= https://erlang.mk/res/relx-v3.24.5
6709 RELX_URL ?= https://erlang.mk/res/relx-v3.26.0
67116710 RELX_OPTS ?=
67126711 RELX_OUTPUT_DIR ?= _rel
67136712 RELX_REL_EXT ?=
67806779
67816780 run:: all
67826781 $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) console
6782
6783 ifdef RELOAD
6784 rel::
6785 $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) ping
6786 $(verbose) $(RELX_OUTPUT_DIR)/$(RELX_REL_NAME)/bin/$(RELX_REL_NAME)$(RELX_REL_EXT) \
6787 eval "io:format(\"~p~n\", [c:lm()])"
6788 endif
67836789
67846790 help::
67856791 $(verbose) printf "%s\n" "" \