aboutsummaryrefslogtreecommitdiffstats
path: root/core/deps.mk
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2015-08-27 18:31:58 +0200
committerLoïc Hoguin <[email protected]>2015-08-27 18:31:58 +0200
commita0563a428a2eb2d842dada83437b971ccc8b9fb5 (patch)
tree2aff4ed9f945926f494c00666769a2ed97f30852 /core/deps.mk
parent30f9a0f94ba3476d1405cf697870584804a41e35 (diff)
downloaderlang.mk-a0563a428a2eb2d842dada83437b971ccc8b9fb5.tar.gz
erlang.mk-a0563a428a2eb2d842dada83437b971ccc8b9fb5.tar.bz2
erlang.mk-a0563a428a2eb2d842dada83437b971ccc8b9fb5.zip
Add support for external plugins
Plugins can automatically be fetched and included from dependencies. All that is needed is to add either the dependency name or the name + path of the plugin to the DEP_PLUGINS variable. Useful for allowing tools to easily add support for new targets, adding templates or for putting the whole build ecosystem in one common dependency.
Diffstat (limited to 'core/deps.mk')
-rw-r--r--core/deps.mk15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/deps.mk b/core/deps.mk
index 44b822e..4ac58ca 100644
--- a/core/deps.mk
+++ b/core/deps.mk
@@ -573,3 +573,18 @@ $(foreach dep,$(DEPS),$(eval $(call dep_target,$(dep))))
distclean-deps:
$(gen_verbose) rm -rf $(DEPS_DIR)
+
+# 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))))