From 28fbb7673a789335992c3c404b724e8a8c5627f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 19 Apr 2017 18:07:03 +0200 Subject: Move external plugin loading at the end of erlang.mk This allows all plugins to append to existing variables and makes it easier to augment the functionality of the core plugins. --- build.config | 3 +++ core/deps.mk | 15 --------------- core/plugins.mk | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 15 deletions(-) create mode 100644 core/plugins.mk diff --git a/build.config b/build.config index dad175c..44b4710 100644 --- a/build.config +++ b/build.config @@ -40,5 +40,8 @@ plugins/xref plugins/cover plugins/sfx +# External plugins. +core/plugins + # Core modules which can use variables from plugins. core/deps-tools diff --git a/core/deps.mk b/core/deps.mk index 3cbcd45..72b75b0 100644 --- a/core/deps.mk +++ b/core/deps.mk @@ -591,18 +591,3 @@ ERLANG_MK_RECURSIVE_DOC_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-doc-deps-list.log ERLANG_MK_RECURSIVE_REL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-rel-deps-list.log ERLANG_MK_RECURSIVE_TEST_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-test-deps-list.log ERLANG_MK_RECURSIVE_SHELL_DEPS_LIST = $(ERLANG_MK_TMP)/recursive-shell-deps-list.log - -# External plugins. - -DEP_PLUGINS ?= - -define core_dep_plugin --include $(DEPS_DIR)/$(1) - -$(DEPS_DIR)/$(1): $(DEPS_DIR)/$(2) ; -endef - -$(foreach p,$(DEP_PLUGINS),\ - $(eval $(if $(findstring /,$p),\ - $(call core_dep_plugin,$p,$(firstword $(subst /, ,$p))),\ - $(call core_dep_plugin,$p/plugins.mk,$p)))) diff --git a/core/plugins.mk b/core/plugins.mk new file mode 100644 index 0000000..73f2d47 --- /dev/null +++ b/core/plugins.mk @@ -0,0 +1,17 @@ +# Copyright (c) 2013-2017, Loïc Hoguin +# This file is part of erlang.mk and subject to the terms of the ISC License. + +# External plugins. + +DEP_PLUGINS ?= + +define core_dep_plugin +-include $(DEPS_DIR)/$(1) + +$(DEPS_DIR)/$(1): $(DEPS_DIR)/$(2) ; +endef + +$(foreach p,$(DEP_PLUGINS),\ + $(eval $(if $(findstring /,$p),\ + $(call core_dep_plugin,$p,$(firstword $(subst /, ,$p))),\ + $(call core_dep_plugin,$p/plugins.mk,$p)))) -- cgit v1.2.3