|
@@ -204,6 +204,7 @@ BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf)
|
|
|
BUILD_DIR := $(BASE_DIR)/build
|
|
|
BINARIES_DIR := $(BASE_DIR)/images
|
|
|
BASE_TARGET_DIR := $(BASE_DIR)/target
|
|
|
+PER_PACKAGE_DIR := $(BASE_DIR)/per-package
|
|
|
# initial definition so that 'make clean' works for most users, even without
|
|
|
# .config. HOST_DIR will be overwritten later when .config is included.
|
|
|
HOST_DIR := $(BASE_DIR)/host
|
|
@@ -452,12 +453,13 @@ XZCAT := $(call qstrip,$(BR2_XZCAT))
|
|
|
LZCAT := $(call qstrip,$(BR2_LZCAT))
|
|
|
TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf
|
|
|
|
|
|
-# packages compiled for the host go here
|
|
|
+ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
|
|
|
+HOST_DIR = $(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/host,$(call qstrip,$(BR2_HOST_DIR)))
|
|
|
+TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/target,$(BASE_TARGET_DIR)))
|
|
|
+else
|
|
|
HOST_DIR := $(call qstrip,$(BR2_HOST_DIR))
|
|
|
-
|
|
|
-# The target directory is common to all packages,
|
|
|
-# but there is one that is specific to each filesystem.
|
|
|
TARGET_DIR = $(if $(ROOTFS),$(ROOTFS_$(ROOTFS)_TARGET_DIR),$(BASE_TARGET_DIR))
|
|
|
+endif
|
|
|
|
|
|
ifneq ($(HOST_DIR),$(BASE_DIR)/host)
|
|
|
HOST_DIR_SYMLINK = $(BASE_DIR)/host
|
|
@@ -593,8 +595,8 @@ world: target-post-image
|
|
|
.PHONY: prepare-sdk
|
|
|
prepare-sdk: world
|
|
|
@$(call MESSAGE,"Rendering the SDK relocatable")
|
|
|
- $(TOPDIR)/support/scripts/fix-rpath host
|
|
|
- $(TOPDIR)/support/scripts/fix-rpath staging
|
|
|
+ PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath host
|
|
|
+ PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath staging
|
|
|
$(INSTALL) -m 755 $(TOPDIR)/support/misc/relocate-sdk.sh $(HOST_DIR)/relocate-sdk.sh
|
|
|
mkdir -p $(HOST_DIR)/share/buildroot
|
|
|
echo $(HOST_DIR) > $(HOST_DIR)/share/buildroot/sdk-location
|
|
@@ -727,15 +729,19 @@ $(TARGETS_ROOTFS): target-finalize
|
|
|
# Avoid the rootfs name leaking down the dependency chain
|
|
|
target-finalize: ROOTFS=
|
|
|
|
|
|
-host-finalize: $(HOST_DIR_SYMLINK)
|
|
|
+.PHONY: host-finalize
|
|
|
+host-finalize: $(PACKAGES) $(HOST_DIR) $(HOST_DIR_SYMLINK)
|
|
|
+ @$(call MESSAGE,"Finalizing host directory")
|
|
|
+ $(call per-package-rsync,$(sort $(PACKAGES)),host,$(HOST_DIR))
|
|
|
|
|
|
.PHONY: staging-finalize
|
|
|
staging-finalize:
|
|
|
@ln -snf $(STAGING_DIR) $(BASE_DIR)/staging
|
|
|
|
|
|
.PHONY: target-finalize
|
|
|
-target-finalize: $(PACKAGES) host-finalize
|
|
|
+target-finalize: $(PACKAGES) $(TARGET_DIR) host-finalize
|
|
|
@$(call MESSAGE,"Finalizing target directory")
|
|
|
+ $(call per-package-rsync,$(sort $(PACKAGES)),target,$(TARGET_DIR))
|
|
|
# Check files that are touched by more than one package
|
|
|
$(foreach hook,$(TARGET_FINALIZE_HOOKS),$($(hook))$(sep))
|
|
|
rm -rf $(TARGET_DIR)/usr/include $(TARGET_DIR)/usr/share/aclocal \
|
|
@@ -776,7 +782,7 @@ endif
|
|
|
ln -sf ../usr/lib/os-release $(TARGET_DIR)/etc
|
|
|
|
|
|
@$(call MESSAGE,"Sanitizing RPATH in target tree")
|
|
|
- $(TOPDIR)/support/scripts/fix-rpath target
|
|
|
+ PER_PACKAGE_DIR=$(PER_PACKAGE_DIR) $(TOPDIR)/support/scripts/fix-rpath target
|
|
|
|
|
|
# For a merged /usr, ensure that /lib, /bin and /sbin and their /usr
|
|
|
# counterparts are appropriately setup as symlinks ones to the others.
|
|
@@ -1014,7 +1020,7 @@ savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
|
|
|
|
|
|
# staging and target directories do NOT list these as
|
|
|
# dependencies anywhere else
|
|
|
-$(BUILD_DIR) $(BASE_TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST):
|
|
|
+$(BUILD_DIR) $(BASE_TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST) $(PER_PACKAGE_DIR):
|
|
|
@mkdir -p $@
|
|
|
|
|
|
# outputmakefile generates a Makefile in the output directory, if using a
|
|
@@ -1046,7 +1052,7 @@ printvars:
|
|
|
clean:
|
|
|
rm -rf $(BASE_TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) $(HOST_DIR_SYMLINK) \
|
|
|
$(BUILD_DIR) $(BASE_DIR)/staging \
|
|
|
- $(LEGAL_INFO_DIR) $(GRAPHS_DIR)
|
|
|
+ $(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR)
|
|
|
|
|
|
.PHONY: distclean
|
|
|
distclean: clean
|