diff options
author | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-01-11 14:05:44 +0100 |
---|---|---|
committer | Abdoulaye Walsimou Gaye <awg@embtoolkit.org> | 2014-01-11 14:05:44 +0100 |
commit | 9d97810fb93f3c2ba17dfe596ee40d4f6506dbf8 (patch) | |
tree | bbcee4cd8c112e823b0d4d955be48817a4e2f3a7 | |
parent | 33e6854d9f942e374fb9a20715e44aceb875eff9 (diff) | |
download | embtoolkit-9d97810fb93f3c2ba17dfe596ee40d4f6506dbf8.tar.gz embtoolkit-9d97810fb93f3c2ba17dfe596ee40d4f6506dbf8.tar.bz2 embtoolkit-9d97810fb93f3c2ba17dfe596ee40d4f6506dbf8.tar.xz |
Build system: add embtk_include_{host}pkg macros
Now to include foo package in the build system, we need to use:
$(call embtk_include_pkg,foo)
or if the pacakge is host package:
$(call embtk_include_hostpkg,foo)
This will avoid pointless include of packages .mk files and will hopefully
increase the build system overall performance.
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
-rw-r--r-- | mk/macros.packages.mk | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/mk/macros.packages.mk b/mk/macros.packages.mk index df1846d..77c17e7 100644 --- a/mk/macros.packages.mk +++ b/mk/macros.packages.mk @@ -802,6 +802,43 @@ define embtk_decompress_pkg endef # +# Macros to include a package in the build system +# +define embtk_include_pkg + $(eval $(call __embtk_include_pkg,$(1))) +endef +define __embtk_include_pkg + # Is it necessary to include .mk file? + ifeq (x$(__embtk_pkg_inc_mkinclude),xy) + include $(dir $(lastword $(MAKEFILE_LIST)))$(pkgv)/$(pkgv).mk + endif + ifeq (x$(CONFIG_EMBTK_HAVE_$(PKGV)),xy) + ROOTFS_COMPONENTS-y += $(pkgv)_install + else ifeq (x$(__embtk_pkg_inc_curinstalled),xy) + ROOTFS_COMPONENTS- += $(pkgv)_install + endif +endef + +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 + endif + ifeq (x$(CONFIG_EMBTK_HOST_HAVE_$(PKGV)),xy) + HOSTTOOLS_COMPONENTS-y += $(pkgv)_install + else ifeq (x$(__embtk_pkg_inc_curinstalled),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) + +# # A macro to clean installed packages from sysroot. # Usage: # $(call embtk_cleanup_pkg,pkgname) |