summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Marangi2024-10-24 18:13:07 +0000
committerChristian Marangi2024-10-28 23:07:51 +0000
commit5667b380cd30eeaeb39f0445bcb62b704f2c3223 (patch)
tree62181c5433a11b1d72e15103fc810798c28bd4db
parent221f81a330999583da7ba05fa8d6445c41608852 (diff)
downloadopenwrt-5667b380cd30eeaeb39f0445bcb62b704f2c3223.tar.gz
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 <ansuelsmth@gmail.com>
-rw-r--r--rules.mk4
1 files 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)