aboutsummaryrefslogtreecommitdiffstats
path: root/core/plugins.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2017-04-19 18:07:03 +0200
committerLoïc Hoguin <[email protected]>2017-04-19 18:07:03 +0200
commit28fbb7673a789335992c3c404b724e8a8c5627f0 (patch)
treeb2883c8979d2f6d575274c55c04e25ab375b60b6 /core/plugins.mk
parent7a200f54a9c0a41be4bad93e3ad0b19bbde5267f (diff)
downloaderlang.mk-28fbb7673a789335992c3c404b724e8a8c5627f0.tar.gz
erlang.mk-28fbb7673a789335992c3c404b724e8a8c5627f0.tar.bz2
erlang.mk-28fbb7673a789335992c3c404b724e8a8c5627f0.zip
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.
Diffstat (limited to 'core/plugins.mk')
-rw-r--r--core/plugins.mk17
1 files changed, 17 insertions, 0 deletions
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 <[email protected]>
+# 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))))