[openwrt/openwrt] build: permit overwrite PACKAGE_DIR and PACKAGE_DIR_ALL
LEDE Commits
lede-commits at lists.infradead.org
Mon Oct 28 16:08:19 PDT 2024
ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/5667b380cd30eeaeb39f0445bcb62b704f2c3223
commit 5667b380cd30eeaeb39f0445bcb62b704f2c3223
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Thu Oct 24 20:13:07 2024 +0200
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 at gmail.com>
---
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)
More information about the lede-commits
mailing list