edoc.mk 878 B

12345678910111213141516171819202122232425262728293031323334
  1. # Copyright (c) 2013-2016, Loïc Hoguin <essen@ninenines.eu>
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: distclean-edoc edoc
  4. # Configuration.
  5. EDOC_OPTS ?=
  6. EDOC_SRC_DIRS ?=
  7. define edoc.erl
  8. SrcPaths = lists:foldl(fun(P, Acc) ->
  9. filelib:wildcard(atom_to_list(P) ++ "/{src,c_src}") ++ Acc
  10. end, [], [$(call comma_list,$(patsubst %,'%',$(EDOC_SRC_DIRS)))]),
  11. DefaultOpts = [{source_path, SrcPaths}, {subpackages, false}],
  12. edoc:application($(1), ".", [$(2)] ++ DefaultOpts),
  13. halt(0).
  14. endef
  15. # Core targets.
  16. ifneq ($(strip $(EDOC_SRC_DIRS)$(wildcard doc/overview.edoc)),)
  17. docs:: edoc
  18. endif
  19. distclean:: distclean-edoc
  20. # Plugin-specific targets.
  21. edoc: distclean-edoc doc-deps
  22. $(gen_verbose) $(call erlang,$(call edoc.erl,$(PROJECT),$(EDOC_OPTS)))
  23. distclean-edoc:
  24. $(gen_verbose) rm -f doc/*.css doc/*.html doc/*.png doc/edoc-info