diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-09-16 21:22:45 +0200 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-09-16 21:25:58 +0200 |
commit | 2f31f13d447c642b46829fbebb4716d7d6c77358 (patch) | |
tree | 6c5b01edb0bb3defd51f53a8cb5473e2752f73b1 | |
parent | 6d5073a660b53b66fe66a83569d10a6848d3e87c (diff) | |
download | embtoolkit-2f31f13d447c642b46829fbebb4716d7d6c77358.tar.gz embtoolkit-2f31f13d447c642b46829fbebb4716d7d6c77358.tar.bz2 embtoolkit-2f31f13d447c642b46829fbebb4716d7d6c77358.tar.xz |
Build system: add dedicated embtk_include_xtoolpkg macros for toolchain components
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r-- | core/mk/pkg-macros/include.mk | 42 | ||||
-rw-r--r-- | core/toolchain/common.mk | 7 |
2 files changed, 49 insertions, 0 deletions
diff --git a/core/mk/pkg-macros/include.mk b/core/mk/pkg-macros/include.mk index 91be947..46134c4 100644 --- a/core/mk/pkg-macros/include.mk +++ b/core/mk/pkg-macros/include.mk @@ -92,3 +92,45 @@ define __embtk_include_hostpkg __embtk_$(pkgv)_installed = endif endef + +# +# Macros to include toolchain packages in the build system +# $(1): pkgname => pkgname/pkgname.mk should exist (required) +# $(2): xtool component: toolchain_predeps, toolchain_deps or +# toolchain_addons_deps (required). +# $(3): kconfig: package specific kconfig symbol name used in .kconfig +# This parameter is optional. + +define embtk_include_xtoolpkg + $(eval $(call __embtk_include_xtoolpkg,$(1),$(2),$(3))) +endef +define __embtk_include_xtoolpkg + $(eval __embtk_inc_pkgname := $(or $(3),$(PKGV))) + # Case where foo and foo_host are in the same .mk file + $(eval __embtk_incmk0 := $(embtk_pkgincdir)/$(pkgv)/$(pkgv).mk) + $(eval __embtk_incmk1 := $(embtk_pkgincdir)/$(patsubst %_host,%,$(pkgv))/$(patsubst %_host,%,$(pkgv)).mk) + $(eval __embtk_incmk := $(or $(wildcard $(__embtk_incmk0)),$(wildcard $(__embtk_incmk1)),$(wildcard $(__embtk_incmk0)))) + $(eval __embtk_incinstalled-y := $(if $(wildcard $(__embtk_pkg_dotinstalled_f)),y)) + $(eval __embtk_incmk-y := $(if $(__embtk_incenabled-y)$(__embtk_incinstalled-y),y)) + # Is it necessary to include the .mk file? + $(eval __embtk_incmk-y := $(if $(findstring $(__embtk_incmk),$(MAKEFILE_LIST)),,$(__embtk_incmk-y))) + ifeq (x$(__embtk_incmk-y),xy) + include $(__embtk_incmk) + endif + ifeq (x$(__embtk_incenabled-y),xy) + EMBTK_$(call embtk_ucase,$(2))-y += $(pkgv)_install + # also include old package kconfig entries if any + -include $(__embtk_pkg_dotkconfig_f) + else ifeq (x$(__embtk_incinstalled-y),xy) + EMBTK_$(call embtk_ucase,$(2))- += $(pkgv)_install + endif + # Preset build system installed variable for this packages, if installed + ifeq (x$(__embtk_incinstalled-y),xy) + __embtk_$(pkgv)_installed = y + else + __embtk_$(pkgv)_installed = + endif + # preset some variables + $(eval __embtk_$(pkgv)_category := $(call __embtk_mk_uquote,$(or $(CONFIG_EMBTK_$(PKGV)_REFSPEC),$(CONFIG_EMBTK_$(PKGV)_CATEGORY)))) + __embtk_$(pkgv)_category := $(or $(___embtk_$(pkgv)_category),$(2)) +endef diff --git a/core/toolchain/common.mk b/core/toolchain/common.mk index 8fa54b4..3c6a75d 100644 --- a/core/toolchain/common.mk +++ b/core/toolchain/common.mk @@ -24,6 +24,13 @@ ################################################################################ # +# Toolchain components init +# +EMBTK_TOOLCHAIN_PREDEPS-y := +EMBTK_TOOLCHAIN_DEPS-y := +EMBTK_TOOLCHAIN_ADDONS_DEPS-y := + +# # Toolchain base directory definition # __xtools_compiler-$(CONFIG_EMBTK_LLVM_ONLY_TOOLCHAIN) := clangllvm-$(call embtk_pkg_version,llvm_host) |