From 5667b380cd30eeaeb39f0445bcb62b704f2c3223 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Thu, 24 Oct 2024 20:13:07 +0200 Subject: [PATCH] build: permit overwrite PACKAGE_DIR and PACKAGE_DIR_ALL Permit to overwrite PACKAGE_DIR and PACKAGE_DIR_ALL variables in rules.mk. This is to handle a special case with the ImageBuilder where these variable are overwrite. The main problem is that any include calling rules.mk again (example image.mk) will set these variables again dropping the modified value. To keep the modified value, set the PACKAGE_DIR and PACKAGE_DIR_ALL only if not already set. This permits the ImageBuilder to use custom directory instead of the default one defined in rules.mk. Signed-off-by: Christian Marangi --- rules.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.mk b/rules.mk index ae20742bd7..973fd1cbb9 100644 --- a/rules.mk +++ b/rules.mk @@ -141,8 +141,8 @@ ifeq ($(or $(CONFIG_EXTERNAL_TOOLCHAIN),$(CONFIG_TARGET_uml)),) iremap = -f$(if $(CONFIG_REPRODUCIBLE_DEBUG_INFO),file,macro)-prefix-map=$(1)=$(2) endif -PACKAGE_DIR:=$(BIN_DIR)/packages -PACKAGE_DIR_ALL:=$(TOPDIR)/staging_dir/packages/$(BOARD) +PACKAGE_DIR?=$(BIN_DIR)/packages +PACKAGE_DIR_ALL?=$(TOPDIR)/staging_dir/packages/$(BOARD) BUILD_DIR:=$(BUILD_DIR_BASE)/$(TARGET_DIR_NAME) STAGING_DIR:=$(TOPDIR)/staging_dir/$(TARGET_DIR_NAME) BUILD_DIR_TOOLCHAIN:=$(BUILD_DIR_BASE)/$(TOOLCHAIN_DIR_NAME) -- 2.30.2