diff mbox series

[19/20,WIP] build: point remainder at $(LINUX_SRC_DIR)

Message ID 7155e3e04a01553c15cfb5ac36c27f8e4f90d845.1700010295.git.ehem+openwrt@m5p.com
State Not Applicable
Delegated to: Petr Štetiar
Headers show
Series Kernel build fixups, split object directory off (partial WIP) | expand

Commit Message

Elliott Mitchell Nov. 12, 2023, 6:51 a.m. UTC
These appear to need the kernel source, but my confidence is less than
certain on several spots.

Signed-off-by: Elliott Mitchell <ehem+openwrt@m5p.com>
---
 include/kernel-defaults.mk               | 6 +++---
 package/kernel/cryptodev-linux/Makefile  | 2 +-
 package/kernel/linux/modules/w1.mk       | 4 ++--
 package/kernel/qca-ssdk/Makefile         | 2 +-
 package/network/utils/arptables/Makefile | 2 +-
 target/imagebuilder/Makefile             | 2 +-
 target/imagebuilder/files/Makefile       | 4 ++--
 target/sdk/Makefile                      | 6 +++---
 toolchain/kernel-headers/Makefile        | 2 +-
 9 files changed, 15 insertions(+), 15 deletions(-)
diff mbox series

Patch

diff --git a/include/kernel-defaults.mk b/include/kernel-defaults.mk
index 178d4c0a5d..a170e86cef 100644
--- a/include/kernel-defaults.mk
+++ b/include/kernel-defaults.mk
@@ -31,10 +31,10 @@  ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
 else
   define Kernel/Prepare/Default
 	mkdir -p $(KERNEL_BUILD_DIR)
-	if [ -d $(LINUX_DIR) ]; then \
-		rmdir $(LINUX_DIR); \
+	if [ -d $(LINUX_SRC_DIR) ]; then \
+		rmdir $(LINUX_SRC_DIR); \
 	fi
-	ln -s $(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_DIR)
+	ln -s $(CONFIG_EXTERNAL_KERNEL_TREE) $(LINUX_SRC_DIR)
 	if [ -d $(LINUX_OBJ_DIR)/user_headers ]; then \
 		rm -rf $(LINUX_OBJ_DIR)/user_headers; \
 	fi
diff --git a/package/kernel/cryptodev-linux/Makefile b/package/kernel/cryptodev-linux/Makefile
index 0c1f63a605..40692eb060 100644
--- a/package/kernel/cryptodev-linux/Makefile
+++ b/package/kernel/cryptodev-linux/Makefile
@@ -47,7 +47,7 @@  endef
 define Build/Compile
 	$(MAKE) -C $(PKG_BUILD_DIR) \
 		$(KERNEL_MAKE_FLAGS) \
-		KERNEL_DIR="$(LINUX_DIR)"
+		KERNEL_DIR="$(LINUX_SRC_DIR)"
 endef
 
 define Build/InstallDev
diff --git a/package/kernel/linux/modules/w1.mk b/package/kernel/linux/modules/w1.mk
index e6b5263e2c..55d7e60cca 100644
--- a/package/kernel/linux/modules/w1.mk
+++ b/package/kernel/linux/modules/w1.mk
@@ -6,8 +6,8 @@ 
 #
 
 W1_MENU:=W1 support
-W1_MASTERS_DIR:=$(LINUX_DIR)/drivers/w1/masters
-W1_SLAVES_DIR:=$(LINUX_DIR)/drivers/w1/slaves
+W1_MASTERS_DIR:=$(LINUX_SRC_DIR)/drivers/w1/masters
+W1_SLAVES_DIR:=$(LINUX_SRC_DIR)/drivers/w1/slaves
 
 define KernelPackage/w1
   SUBMENU:=$(W1_MENU)
diff --git a/package/kernel/qca-ssdk/Makefile b/package/kernel/qca-ssdk/Makefile
index 3770d29e8c..69e1eff8b1 100644
--- a/package/kernel/qca-ssdk/Makefile
+++ b/package/kernel/qca-ssdk/Makefile
@@ -36,7 +36,7 @@  LNX_CONFIG_OPTS = LNX_MAKEOPTS='$(KERNEL_MAKEOPTS)' MODULE_TYPE=KSLIB modules
 MAKE_FLAGS+= \
 	TARGET_NAME=$(CONFIG_TARGET_NAME) \
 	TOOL_PATH=$(firstword $(TOOLCHAIN_BIN_DIRS)) \
-	SYS_PATH=$(LINUX_DIR) \
+	SYS_PATH=$(LINUX_SRC_DIR) \
 	TOOLPREFIX=$(TARGET_CROSS) \
 	KVER=$(LINUX_VERSION) \
 	ARCH=$(LINUX_KARCH) \
diff --git a/package/network/utils/arptables/Makefile b/package/network/utils/arptables/Makefile
index 7f32ed1395..520c7dcf27 100644
--- a/package/network/utils/arptables/Makefile
+++ b/package/network/utils/arptables/Makefile
@@ -32,7 +32,7 @@  endef
 
 MAKE_FLAGS += \
 	COPT_FLAGS="$(TARGET_CFLAGS) -D__OPTIMIZE__=1" \
-	KERNEL_DIR="$(LINUX_DIR)"
+	KERNEL_DIR="$(LINUX_SRC_DIR)"
 
 define Package/arptables-legacy/install
 	$(INSTALL_DIR) $(1)/usr/sbin
diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile
index c4910b6c4b..1a68f6e374 100644
--- a/target/imagebuilder/Makefile
+++ b/target/imagebuilder/Makefile
@@ -15,7 +15,7 @@  override MAKEFLAGS=
 IB_NAME:=$(VERSION_DIST_SANITIZED)-imagebuilder-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET)).$(HOST_OS)-$(HOST_ARCH)
 PKG_BUILD_DIR:=$(BUILD_DIR)/$(IB_NAME)
 IB_KDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(KERNEL_BUILD_DIR))
-IB_LDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR))
+IB_LDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_SRC_DIR))
 IB_DTSDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_SRC_DIR))/arch/$(LINUX_KARCH)/boot/dts/
 IB_IDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(STAGING_DIR_IMAGE))
 
diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile
index 78ec7e2e94..1e4d91324b 100644
--- a/target/imagebuilder/files/Makefile
+++ b/target/imagebuilder/files/Makefile
@@ -184,8 +184,8 @@  package_list: FORCE
 package_install: FORCE
 	@echo
 	@echo Installing packages...
-	$(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/libc_*.ipk $(PACKAGE_DIR)/libc_*.ipk))
-	$(OPKG) install $(firstword $(wildcard $(LINUX_DIR)/kernel_*.ipk $(PACKAGE_DIR)/kernel_*.ipk))
+	$(OPKG) install $(firstword $(wildcard $(LINUX_SRC_DIR)/libc_*.ipk $(PACKAGE_DIR)/libc_*.ipk))
+	$(OPKG) install $(firstword $(wildcard $(LINUX_SRC_DIR)/kernel_*.ipk $(PACKAGE_DIR)/kernel_*.ipk))
 	$(OPKG) install $(BUILD_PACKAGES)
 
 prepare_rootfs: FORCE
diff --git a/target/sdk/Makefile b/target/sdk/Makefile
index 243d58bbaf..d118ff5ed6 100644
--- a/target/sdk/Makefile
+++ b/target/sdk/Makefile
@@ -49,7 +49,7 @@  BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C git svn
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),$(shell cd $(TOPDIR); LC_ALL=C svn info 2>/dev/null | sed -ne 's/^URL: /src-svn base /p'))
 BASE_FEED:=$(if $(BASE_FEED),$(BASE_FEED),src-git-full base $(PROJECT_GIT)/openwrt/openwrt.git$(if $(GIT_BRANCH),;$(GIT_BRANCH),$(if $(GIT_TAGNAME),;$(GIT_TAGNAME))))
 
-KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_DIR))
+KDIR_BASE = $(patsubst $(TOPDIR)/%,%,$(LINUX_SRC_DIR))
 KDIR_ARCHES = $(LINUX_KARCH)
 
 # arch/arm64/ includes reference files in arch/arm/, so we'll need both
@@ -78,7 +78,7 @@  KERNEL_FILES_BASE := \
 	modules.builtin \
 	$(foreach arch,$(KDIR_ARCHES),$(addprefix arch/$(arch)/,$(KERNEL_FILES_ARCH)))
 
-KERNEL_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(KERNEL_FILES_BASE))))
+KERNEL_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_SRC_DIR)/,$(KERNEL_FILES_BASE))))
 
 # The kernel source hosts various userspace utilities sources.
 # These are packaged separately from the kernel and kernel modules.
@@ -91,7 +91,7 @@  USERSPACE_UTILS_FILES := \
 	tools/spi \
 	tools/usb/usbip
 
-USERSPACE_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_DIR)/,$(USERSPACE_UTILS_FILES))))
+USERSPACE_FILES := $(patsubst $(TOPDIR)/%,%,$(wildcard $(addprefix $(LINUX_SRC_DIR)/,$(USERSPACE_UTILS_FILES))))
 
 all: compile
 
diff --git a/toolchain/kernel-headers/Makefile b/toolchain/kernel-headers/Makefile
index dc70f32c90..4191173909 100644
--- a/toolchain/kernel-headers/Makefile
+++ b/toolchain/kernel-headers/Makefile
@@ -38,7 +38,7 @@  else
 endif
 HOST_BUILD_DIR:=$(KERNEL_BUILD_DIR)/linux-$(LINUX_VERSION)
 PKG_HASH:=$(LINUX_KERNEL_HASH)
-LINUX_DIR := $(HOST_BUILD_DIR)
+LINUX_SRC_DIR := $(HOST_BUILD_DIR)
 FILES_DIR := 
 PATCH_DIR := ./patches$(if $(wildcard ./patches-$(LINUX_VERSION)),-$(LINUX_VERSION))