From 613410e9d6c62303673c6b95870bbe4ad60729f3 Mon Sep 17 00:00:00 2001 From: Jean Parpaillon Date: Wed, 9 Dec 2015 22:05:43 +0100 Subject: edoc: apps to generate doc for default to ALL_APPS_DIRS + ALL_DEPS_DIRS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit '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' --- plugins/edoc.mk | 22 ++++++++++++++++------ 1 file 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 -- cgit v1.2.3