summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-01-12 15:22:54 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-01-12 15:22:54 +0100
commit8e7422f8dddb1ed1a0bcd5ae92a863311decdbf7 (patch)
tree2bfdab54c9e830a18fd54cce2aa6d1ad35260da5 /mk
parent6f560fbd3a2c511d9c956f5be06136575ef86809 (diff)
downloadembtoolkit-8e7422f8dddb1ed1a0bcd5ae92a863311decdbf7.tar.gz
embtoolkit-8e7422f8dddb1ed1a0bcd5ae92a863311decdbf7.tar.bz2
embtoolkit-8e7422f8dddb1ed1a0bcd5ae92a863311decdbf7.tar.xz
Build system: embtk_include_hostpkg: take into account case where foo and foo_host are in same .mk
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/pkg-macros/incl.mk23
1 files changed, 14 insertions, 9 deletions
diff --git a/mk/pkg-macros/incl.mk b/mk/pkg-macros/incl.mk
index 8909f23..de1a943 100644
--- a/mk/pkg-macros/incl.mk
+++ b/mk/pkg-macros/incl.mk
@@ -53,17 +53,22 @@ define embtk_include_hostpkg
$(eval $(call __embtk_include_hostpkg,$(1)))
endef
define __embtk_include_hostpkg
- # Is it necessary to include .mk file?
- ifeq (x$(__embtk_pkg_inc_hostmkinclude),xy)
- include $(dir $(lastword $(MAKEFILE_LIST)))$(pkgv)/$(pkgv).mk
+ $(eval __embtk_inckconfig := $(or $(2),$(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_incenabled-y := $(CONFIG_EMBTK_HOST_HAVE_$(patsubst %_HOST,%,$(__embtk_inckconfig))))
+ $(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$(CONFIG_EMBTK_HOST_HAVE_$(PKGV)),xy)
+ ifeq (x$(__embtk_incenabled-y),xy)
HOSTTOOLS_COMPONENTS-y += $(pkgv)_install
- else ifeq (x$(__embtk_pkg_inc_curinstalled),xy)
+ else ifeq (x$(__embtk_incinstalled-y),xy)
HOSTTOOLS_COMPONENTS- += $(pkgv)_install
endif
endef
-
-__embtk_pkg_inc_currinstalled = $(if $(wildcard $(__embtk_pkg_dotinstalled_f)),y)
-__embtk_pkg_inc_mkinclude = $(if $(CONFIG_EMBTK_HAVE_$(PKGV))$(__embtk_pkg_currinstalled),y)
-__embtk_pkg_inc_hostmkinclude = $(if $(CONFIG_EMBTK_HOST_HAVE_$(PKGV))$(__embtk_pkg_currinstalled),y)