build: move STAGING_DIR_HOSTPKG and BUILD_DIR_HOST back to a common directory for all targets
Using a single host package staging dir (and build dir) significantly speeds up builds when multiple targets are built in succession, especially for large host packages like NodeJS. $(STAGING_DIR)/host is kept in addition to $(STAGING_DIR_HOSTPKG) in most places; it is still used as destination for host files in Build/InstallDev. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
This commit is contained in:
parent
5f7a081553
commit
3d71786154
6 changed files with 10 additions and 10 deletions
2
Makefile
2
Makefile
|
@ -55,7 +55,7 @@ clean: FORCE
|
||||||
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
|
rm -rf $(BUILD_DIR) $(STAGING_DIR) $(BIN_DIR) $(OUTPUT_DIR)/packages/$(ARCH_PACKAGES) $(BUILD_LOG_DIR) $(TOPDIR)/staging_dir/packages
|
||||||
|
|
||||||
dirclean: clean
|
dirclean: clean
|
||||||
rm -rf $(STAGING_DIR_HOST) $(TOOLCHAIN_DIR) $(BUILD_DIR_HOST) $(BUILD_DIR_TOOLCHAIN)
|
rm -rf $(STAGING_DIR_HOST) $(STAGING_DIR_HOSTPKG) $(TOOLCHAIN_DIR) $(BUILD_DIR_BASE)/host $(BUILD_DIR_BASE)/hostpkg $(BUILD_DIR_TOOLCHAIN)
|
||||||
rm -rf $(TMP_DIR)
|
rm -rf $(TMP_DIR)
|
||||||
|
|
||||||
ifndef DUMP_TARGET_DB
|
ifndef DUMP_TARGET_DB
|
||||||
|
|
|
@ -75,7 +75,7 @@ define autoreconf_target
|
||||||
$(strip $(call autoreconf, \
|
$(strip $(call autoreconf, \
|
||||||
$(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
|
$(PKG_BUILD_DIR), $(PKG_REMOVE_FILES), \
|
||||||
$(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
|
$(PKG_AUTOMAKE_PATHS), $(PKG_LIBTOOL_PATHS), \
|
||||||
$(STAGING_DIR)/host/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
|
$(STAGING_DIR)/host/share/aclocal $(STAGING_DIR_HOSTPKG)/share/aclocal $(STAGING_DIR)/usr/share/aclocal $(PKG_MACRO_PATHS)))
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define patch_libtool_target
|
define patch_libtool_target
|
||||||
|
|
|
@ -34,7 +34,7 @@ CMAKE_NM:=$(call cmake_tool,$(TARGET_NM))
|
||||||
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
|
CMAKE_RANLIB:=$(call cmake_tool,$(TARGET_RANLIB))
|
||||||
|
|
||||||
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
|
CMAKE_FIND_ROOT_PATH:=$(STAGING_DIR)/usr;$(TOOLCHAIN_DIR)$(if $(CONFIG_EXTERNAL_TOOLCHAIN),;$(CONFIG_TOOLCHAIN_ROOT))
|
||||||
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOST)
|
CMAKE_HOST_FIND_ROOT_PATH:=$(STAGING_DIR)/host;$(STAGING_DIR_HOSTPKG);$(STAGING_DIR_HOST)
|
||||||
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
|
CMAKE_SHARED_LDFLAGS:=-Wl,-Bsymbolic-functions
|
||||||
|
|
||||||
define Build/Configure/Default
|
define Build/Configure/Default
|
||||||
|
|
|
@ -122,7 +122,7 @@ ifneq ($(if $(HOST_QUILT),,$(CONFIG_AUTOREBUILD)),)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define Host/Exports/Default
|
define Host/Exports/Default
|
||||||
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
|
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR_HOST)/share/aclocal $$(STAGING_DIR_HOST)/share/aclocal-* $(if $(IS_PACKAGE_BUILD),$$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*)),-I $$(p))
|
||||||
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
|
$(1) : export STAGING_PREFIX=$$(HOST_BUILD_PREFIX)
|
||||||
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
$(1) : export PKG_CONFIG_PATH=$$(STAGING_DIR_HOST)/lib/pkgconfig:$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||||
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
$(1) : export PKG_CONFIG_LIBDIR=$$(HOST_BUILD_PREFIX)/lib/pkgconfig
|
||||||
|
|
|
@ -130,7 +130,7 @@ ifdef USE_SOURCE_DIR
|
||||||
endif
|
endif
|
||||||
|
|
||||||
define Build/Exports/Default
|
define Build/Exports/Default
|
||||||
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
|
$(1) : export ACLOCAL_INCLUDE=$$(foreach p,$$(wildcard $$(STAGING_DIR)/usr/share/aclocal $$(STAGING_DIR)/usr/share/aclocal-* $$(STAGING_DIR_HOSTPKG)/share/aclocal $$(STAGING_DIR_HOSTPKG)/share/aclocal-* $$(STAGING_DIR)/host/share/aclocal $$(STAGING_DIR)/host/share/aclocal-*),-I $$(p))
|
||||||
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
|
$(1) : export STAGING_PREFIX=$$(STAGING_DIR)/usr
|
||||||
$(1) : export PATH=$$(TARGET_PATH_PKG)
|
$(1) : export PATH=$$(TARGET_PATH_PKG)
|
||||||
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
|
$(1) : export CONFIG_SITE:=$$(CONFIG_SITE)
|
||||||
|
|
10
rules.mk
10
rules.mk
|
@ -145,9 +145,9 @@ STAGING_DIR_ROOT:=$(STAGING_DIR)/root-$(BOARD)
|
||||||
BUILD_LOG_DIR:=$(TOPDIR)/logs
|
BUILD_LOG_DIR:=$(TOPDIR)/logs
|
||||||
PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
|
PKG_INFO_DIR := $(STAGING_DIR)/pkginfo
|
||||||
|
|
||||||
BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR)/host,$(BUILD_DIR_BASE)/host)
|
BUILD_DIR_HOST:=$(if $(IS_PACKAGE_BUILD),$(BUILD_DIR_BASE)/hostpkg,$(BUILD_DIR_BASE)/host)
|
||||||
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
|
STAGING_DIR_HOST:=$(TOPDIR)/staging_dir/host
|
||||||
STAGING_DIR_HOSTPKG:=$(STAGING_DIR)/host
|
STAGING_DIR_HOSTPKG:=$(TOPDIR)/staging_dir/hostpkg
|
||||||
|
|
||||||
TARGET_PATH:=$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH)))))
|
TARGET_PATH:=$(subst $(space),:,$(filter-out .,$(filter-out ./,$(subst :,$(space),$(PATH)))))
|
||||||
TARGET_INIT_PATH:=$(call qstrip,$(CONFIG_TARGET_INIT_PATH))
|
TARGET_INIT_PATH:=$(call qstrip,$(CONFIG_TARGET_INIT_PATH))
|
||||||
|
@ -206,7 +206,7 @@ ifndef DUMP
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(TARGET_PATH)
|
TARGET_PATH_PKG:=$(STAGING_DIR)/host/bin:$(STAGING_DIR_HOSTPKG)/bin:$(TARGET_PATH)
|
||||||
|
|
||||||
ifeq ($(CONFIG_SOFT_FLOAT),y)
|
ifeq ($(CONFIG_SOFT_FLOAT),y)
|
||||||
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
|
SOFT_FLOAT_CONFIG_OPTION:=--with-float=soft
|
||||||
|
@ -232,9 +232,9 @@ export PKG_CONFIG
|
||||||
|
|
||||||
HOSTCC:=gcc
|
HOSTCC:=gcc
|
||||||
HOSTCXX:=g++
|
HOSTCXX:=g++
|
||||||
HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR)/host/include)
|
HOST_CPPFLAGS:=-I$(STAGING_DIR_HOST)/include -I$(STAGING_DIR_HOST)/usr/include $(if $(IS_PACKAGE_BUILD),-I$(STAGING_DIR_HOSTPKG)/include -I$(STAGING_DIR)/host/include)
|
||||||
HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
|
HOST_CFLAGS:=-O2 $(HOST_CPPFLAGS)
|
||||||
HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR)/host/lib)
|
HOST_LDFLAGS:=-L$(STAGING_DIR_HOST)/lib -L$(STAGING_DIR_HOST)/usr/lib $(if $(IS_PACKAGE_BUILD),-L$(STAGING_DIR_HOSTPKG)/lib -L$(STAGING_DIR)/host/lib)
|
||||||
|
|
||||||
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
||||||
TARGET_AR:=$(TARGET_CROSS)gcc-ar
|
TARGET_AR:=$(TARGET_CROSS)gcc-ar
|
||||||
|
|
Loading…
Reference in a new issue