summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-01-08 21:33:42 +0100
committerAbdoulaye Walsimou Gaye <awg@embtoolkit.org>2014-01-08 21:33:42 +0100
commit7fd3b8c890a4519ecfddf10b621e48242ee5a2da (patch)
tree8dad05454bdde055d53d64683987a664cc7d03a9 /mk
parent6f1d674ac147841dd7c525141854355087c3d4f4 (diff)
downloadembtoolkit-7fd3b8c890a4519ecfddf10b621e48242ee5a2da.tar.gz
embtoolkit-7fd3b8c890a4519ecfddf10b621e48242ee5a2da.tar.bz2
embtoolkit-7fd3b8c890a4519ecfddf10b621e48242ee5a2da.tar.xz
Build system: give ability to wipe out packages workspace after successful build
Signed-off-by: Abdoulaye Walsimou Gaye <awg@embtoolkit.org>
Diffstat (limited to 'mk')
-rw-r--r--mk/binutils.mk2
-rw-r--r--mk/macros.packages.mk22
2 files changed, 20 insertions, 4 deletions
diff --git a/mk/binutils.mk b/mk/binutils.mk
index 1f5344f..d4cf8e5 100644
--- a/mk/binutils.mk
+++ b/mk/binutils.mk
@@ -31,6 +31,8 @@ BINUTILS_PACKAGE := binutils-$(BINUTILS_VERSION).tar.bz2
BINUTILS_SRC_DIR := $(embtk_toolsb)/binutils-$(BINUTILS_VERSION)
BINUTILS_BUILD_DIR := $(embtk_toolsb)/binutils-build
+BINUTILS_KEEP_SRC_DIR := $(embtk_toolchain_has_llvm-y)
+
BINUTILS_CONFIGURE_OPTS := --disable-werror --with-sysroot=$(embtk_sysroot)
BINUTILS_CONFIGURE_OPTS += --disable-nls --disable-multilib
BINUTILS_CONFIGURE_OPTS += --enable-gold --enable-plugins
diff --git a/mk/macros.packages.mk b/mk/macros.packages.mk
index a184a9f..9e22103 100644
--- a/mk/macros.packages.mk
+++ b/mk/macros.packages.mk
@@ -155,6 +155,7 @@ __embtk_pkg_version = $(or $(__embtk_pkg_usegit),$(__embtk_pkg_versionsvn),$(st
__embtk_pkg_package_f = $(strip $(embtk_dldir))/$(__embtk_pkg_package)
__embtk_pkg_srcdir = $(or $(__embtk_pkg_localgit),$(__embtk_pkg_localsvn),$(patsubst %/,%,$(strip $($(PKGV)_SRC_DIR))))
__embtk_pkg_builddir = $(patsubst %/,%,$(strip $($(PKGV)_BUILD_DIR)))
+__embtk_pkg_nowipeworkspace = $(strip $($(PKGV)_KEEP_SRC_DIR))
# State dir: where build system stores package states: installed, patched, etc.
____embtk_pkg_statedir = $(dir $(__embtk_pkg_builddir))
___embtk_pkg_statedir = $(____embtk_pkg_statedir)/.embtk-$(__embtk_pkg_name)-$(pkgv)
@@ -222,6 +223,14 @@ __embtk_unsetinstalled_pkg = rm -rf $(__embtk_pkg_dotinstalled_f)
__embtk_setkconfigured_pkg = mkdir -p $(__embtk_pkg_statedir) && touch $(__embtk_pkg_dotkconfig_f)
__embtk_unsetkconfigured_pkg = rm -rf $(__embtk_pkg_dotkconfig_f)
+ifeq ($(CONFIG_EMBTK_WIPEOUTWORKSPACES),y)
+define __embtk_wipeoutworkspace_pkg
+ $(if $(__embtk_pkg_usegit)$(__embtk_pkg_usesvn),,
+ rm -rf $(__embtk_pkg_builddir)
+ rm -rf $(__embtk_pkg_srcdir))
+endef
+endif
+
# Some useful macros about packages
__embtk_rootfs_pkgs-y = $(patsubst %_install,%,$(ROOTFS_COMPONENTS-y))
__embtk_rootfs_nrpkgs-y = $(words $(__embtk_rootfs_pkgs-y))
@@ -545,7 +554,9 @@ __embtk_xinstall_xpkg_allvarset-y = $(and $(__embtk_pkg_name), \
define __embtk_install_pkg
$(if $(__embtk_pkg_installed-y),true,
$(Q)mkdir -p $(__embtk_pkg_builddir)
- $(Q)$(call __embtk_install_pkg_make,$(1),autotools))
+ $(Q)$(call __embtk_install_pkg_make,$(1),autotools)
+ $(call __embtk_wipeoutworkspace_pkg,$(1)))
+ $(call __embtk_wipeoutworkspace_pkg,$(1))
$(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv)))
endef
@@ -565,7 +576,8 @@ define embtk_makeinstall_pkg
$(if $(__embtk_xinstall_xpkg_allvarset-y),
$(if $(__embtk_pkg_installed-y),true,
$(Q)mkdir -p $(__embtk_pkg_builddir)
- $(Q)$(call __embtk_install_pkg_make,$(1)))
+ $(Q)$(call __embtk_install_pkg_make,$(1))
+ $(call __embtk_wipeoutworkspace_pkg,$(1)))
$(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv))),
$(call __embtk_install_paramsfailure,$(1)))
endef
@@ -580,7 +592,8 @@ endef
define __embtk_install_hostpkg
$(if $(__embtk_pkg_installed-y),true,
$(Q)mkdir -p $(__embtk_pkg_builddir)
- $(Q)$(call __embtk_install_hostpkg_make,$(1),autotools))
+ $(Q)$(call __embtk_install_hostpkg_make,$(1),autotools)
+ $(call __embtk_wipeoutworkspace_pkg,$(1)))
$(if $(embtk_postinstall_$(pkgv)),$(embtk_postinstall_$(pkgv)))
endef
define embtk_install_hostpkg
@@ -599,7 +612,8 @@ define embtk_makeinstall_hostpkg
$(if $(__embtk_xinstall_xpkg_allvarset-y),
$(if $(__embtk_pkg_installed-y),true,
$(Q)mkdir -p $(__embtk_pkg_builddir)
- $(Q)$(call __embtk_install_hostpkg_make,$(1)))
+ $(Q)$(call __embtk_install_hostpkg_make,$(1))
+ $(call __embtk_wipeoutworkspace_pkg,$(1)))
$(or $(embtk_postinstall_$(pkgv)),true),
$(call __embtk_install_paramsfailure,$(1)))
endef