aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/edoc.mk
blob: f2f4053d9d5dd3b388c0bb91bd95e7dc5ffd1ff9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (c) 2013-2016, Loïc Hoguin <[email protected]>
# This file is part of erlang.mk and subject to the terms of the ISC License.

.PHONY: distclean-edoc edoc

# 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.
docs:: distclean-edoc edoc

distclean:: distclean-edoc

# Plugin-specific targets.

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