From a0563a428a2eb2d842dada83437b971ccc8b9fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 27 Aug 2015 18:31:58 +0200 Subject: 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. --- core/deps.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'core/deps.mk') 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)))) -- cgit v1.2.3