From ecd4344f3ef7e1b12e6506dd0b5d6e644894b9e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Sat, 13 May 2017 22:35:11 +0200 Subject: Add a test for EDOC_SRC_DIRS and tweak the feature a bit --- plugins/edoc.mk | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins') diff --git a/plugins/edoc.mk b/plugins/edoc.mk index f2f4053..b4917cc 100644 --- a/plugins/edoc.mk +++ b/plugins/edoc.mk @@ -6,28 +6,28 @@ # Configuration. EDOC_OPTS ?= -EDOC_SRC_DIRS ?= $(ALL_APPS_DIRS) $(ALL_DEPS_DIRS) +EDOC_SRC_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} ], + 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. -docs:: distclean-edoc edoc + +ifneq ($(strip $(EDOC_SRC_DIRS)$(wildcard doc/overview.edoc)),) +docs:: edoc +endif distclean:: distclean-edoc # Plugin-specific targets. -edoc: doc-deps +edoc: distclean-edoc doc-deps $(gen_verbose) $(call erlang,$(call edoc.erl,$(PROJECT),$(EDOC_OPTS))) distclean-edoc: -- cgit v1.2.3