aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/edoc.mk
diff options
context:
space:
mode:
authorJean Parpaillon <[email protected]>2015-12-09 22:05:43 +0100
committerLoïc Hoguin <[email protected]>2017-05-13 18:54:06 +0200
commit613410e9d6c62303673c6b95870bbe4ad60729f3 (patch)
treea74dba6e49b26127e1cdd52d58fe4d63f7863a77 /plugins/edoc.mk
parent68bb586e605c62ba9fc7c7bebe14529121dcc53a (diff)
downloaderlang.mk-613410e9d6c62303673c6b95870bbe4ad60729f3.tar.gz
erlang.mk-613410e9d6c62303673c6b95870bbe4ad60729f3.tar.bz2
erlang.mk-613410e9d6c62303673c6b95870bbe4ad60729f3.zip
edoc: apps to generate doc for default to ALL_APPS_DIRS + ALL_DEPS_DIRS
'source_path' property of edoc default to the list of explicit deps and apps Can be overriden with EDOC_SRC_DIRS In general, edoc options can be overriden with EDOC_OPTS, à la proplists 'source_path' edoc property is not recursive: look for source code in 'src' and 'c_src'
Diffstat (limited to 'plugins/edoc.mk')
-rw-r--r--plugins/edoc.mk22
1 files changed, 16 insertions, 6 deletions
diff --git a/plugins/edoc.mk b/plugins/edoc.mk
index 67d8968..f2f4053 100644
--- a/plugins/edoc.mk
+++ b/plugins/edoc.mk
@@ -6,19 +6,29 @@
# Configuration.
EDOC_OPTS ?=
+EDOC_SRC_DIRS ?= $(ALL_APPS_DIRS) $(ALL_DEPS_DIRS)
+
+# TODO: use double-quote instead of single + atom_to_list
+# The problem is in correctly escaping double-quotes
+define edoc.erl
+ SrcPaths = lists:foldl(fun (P, Acc) ->
+ filelib:wildcard(atom_to_list(P) ++ "/{src,c_src}") ++ Acc
+ end, [], [$(call comma_list,$(patsubst %,'%',$(EDOC_SRC_DIRS)))]),
+ DefaultOpts = [ {source_path, SrcPaths}
+ ,{subpackages, false} ],
+ edoc:application($(1), ".", [$(2)] ++ DefaultOpts),
+ halt(0).
+endef
# Core targets.
-
-ifneq ($(wildcard doc/overview.edoc),)
-docs:: edoc
-endif
+docs:: distclean-edoc edoc
distclean:: distclean-edoc
# Plugin-specific targets.
-edoc: distclean-edoc doc-deps
- $(gen_verbose) $(ERL) -eval 'edoc:application($(PROJECT), ".", [$(EDOC_OPTS)]), halt().'
+edoc: doc-deps
+ $(gen_verbose) $(call erlang,$(call edoc.erl,$(PROJECT),$(EDOC_OPTS)))
distclean-edoc:
$(gen_verbose) rm -f doc/*.css doc/*.html doc/*.png doc/edoc-info