diff mbox series

[12/20,WIP] build: adjust include paths to use LINUX_SRC_DIR/LINUX_OBJ_DIR

Message ID d0885cdb69a39768f3a6d68151cb3a8bd90b3d8a.1700010293.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
Most headers come out of the source.  Some spots also reference the
kernel build directory.

Signed-off-by: Elliott Mitchell <ehem+openwrt@m5p.com>
---
 include/image.mk                                 | 3 ++-
 include/kernel.mk                                | 2 +-
 package/devel/perf/Makefile                      | 2 +-
 package/kernel/bpf-headers/Makefile              | 6 +++---
 package/kernel/lantiq/ltq-adsl/Makefile          | 4 ++--
 package/kernel/lantiq/ltq-ifxos/Makefile         | 4 ++--
 package/kernel/lantiq/ltq-tapi/Makefile          | 4 ++--
 package/kernel/lantiq/ltq-vdsl-vr11-mei/Makefile | 4 ++--
 package/kernel/lantiq/ltq-vdsl-vr11/Makefile     | 4 ++--
 package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile  | 4 ++--
 package/kernel/lantiq/ltq-vdsl-vr9/Makefile      | 4 ++--
 package/kernel/lantiq/ltq-vmmc/Makefile          | 4 ++--
 package/kernel/mac80211/Makefile                 | 6 +++---
 package/network/config/ltq-adsl-app/Makefile     | 2 +-
 package/network/services/ppp/Makefile            | 6 +++---
 package/network/utils/iproute2/Makefile          | 2 +-
 package/network/utils/ipset/Makefile             | 2 +-
 17 files changed, 32 insertions(+), 31 deletions(-)
diff mbox series

Patch

diff --git a/include/image.mk b/include/image.mk
index 794b32387d..a0a1d755d4 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -187,7 +187,8 @@  define Image/BuildDTB/sub
 		$(DTS_CPPFLAGS) \
 		-I$(DTS_DIR) \
 		-I$(DTS_DIR)/include \
-		-I$(LINUX_DIR)/include/ \
+		-I$(LINUX_OBJ_DIR)/include/ \
+		-I$(LINUX_SRC_DIR)/include/ \
 		-undef -D__DTS__ $(3) \
 		-o $(2).tmp $(1)
 	$(LINUX_OBJ_DIR)/scripts/dtc/dtc -O dtb \
diff --git a/include/kernel.mk b/include/kernel.mk
index ff34f74bed..8362fa768b 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -71,7 +71,7 @@  else
   else ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
       LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x
   else
-      LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release 2>/dev/null))
+      LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_OBJ_DIR)/include/config/kernel.release 2>/dev/null))
   endif
 
   MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
diff --git a/package/devel/perf/Makefile b/package/devel/perf/Makefile
index f9573c4150..31881c0136 100644
--- a/package/devel/perf/Makefile
+++ b/package/devel/perf/Makefile
@@ -38,7 +38,7 @@  define Package/perf/description
   perf is the Linux performance monitoring tool
 endef
 
-HOST_CFLAGS += -I$(LINUX_DIR)/tools/include
+HOST_CFLAGS += -I$(LINUX_SRC_DIR)/tools/include
 
 TARGET_LDFLAGS += $(INTL_LDFLAGS)
 
diff --git a/package/kernel/bpf-headers/Makefile b/package/kernel/bpf-headers/Makefile
index 5efd2e1cf0..e000a1d56c 100644
--- a/package/kernel/bpf-headers/Makefile
+++ b/package/kernel/bpf-headers/Makefile
@@ -79,10 +79,10 @@  define Build/Configure
 	yes '' | $(KERNEL_MAKE) oldconfig
 	grep 'CONFIG_HZ=' $(REAL_LINUX_DIR)/.config | \
 		cut -d= -f2 | \
-		bc -q $(LINUX_DIR)/kernel/time/timeconst.bc \
-		> $(LINUX_DIR)/include/generated/timeconst.h
+		bc -q $(LINUX_SRC_DIR)/kernel/time/timeconst.bc \
+		> $(LINUX_OBJ_DIR)/include/generated/timeconst.h
 	$(BPF_DOC) --header \
-		--file $(LINUX_DIR)/tools/include/uapi/linux/bpf.h \
+		--file $(LINUX_SRC_DIR)/tools/include/uapi/linux/bpf.h \
 		> $(PKG_BUILD_DIR)/tools/lib/bpf/bpf_helper_defs.h
 endef
 
diff --git a/package/kernel/lantiq/ltq-adsl/Makefile b/package/kernel/lantiq/ltq-adsl/Makefile
index ac96674933..01cf8f8791 100644
--- a/package/kernel/lantiq/ltq-adsl/Makefile
+++ b/package/kernel/lantiq/ltq-adsl/Makefile
@@ -49,7 +49,7 @@  IFX_DSL_CHANNELS_PER_LINE=1
 MAKE_FLAGS += \
 	$(KERNEL_MAKE_FLAGS)
 
-CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
+CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_SRC_DIR)/include" \
 	--with-max-device="$(IFX_DSL_MAX_DEVICE)" \
 	--with-lines-per-device="$(IFX_DSL_LINES_PER_DEVICE)" \
 	--with-channels-per-line="$(IFX_DSL_CHANNELS_PER_LINE)" \
@@ -68,7 +68,7 @@  CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
 	--enable-dsl-pm-line-thresholds \
 	--enable-dsl-pm-optional-parameters \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
 	ARCH=$(LINUX_KARCH)
 
 CONFIG_TAG_danube:=DANUBE
diff --git a/package/kernel/lantiq/ltq-ifxos/Makefile b/package/kernel/lantiq/ltq-ifxos/Makefile
index 97f7ca78ce..f5cb1d233b 100644
--- a/package/kernel/lantiq/ltq-ifxos/Makefile
+++ b/package/kernel/lantiq/ltq-ifxos/Makefile
@@ -41,8 +41,8 @@  endef
 CONFIGURE_ARGS += \
 	ARCH=$(LINUX_KARCH) \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
-	--enable-kernelincl="$(LINUX_DIR)/include" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
+	--enable-kernelincl="$(LINUX_SRC_DIR)/include" \
 	--with-kernel-module
 
 define Build/InstallDev
diff --git a/package/kernel/lantiq/ltq-tapi/Makefile b/package/kernel/lantiq/ltq-tapi/Makefile
index d44eeae565..80435e4c10 100644
--- a/package/kernel/lantiq/ltq-tapi/Makefile
+++ b/package/kernel/lantiq/ltq-tapi/Makefile
@@ -46,8 +46,8 @@  MAKE_FLAGS += \
 CONFIGURE_ARGS += \
 	ARCH=$(LINUX_KARCH) \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
-	--enable-kernelincl="$(LINUX_DIR)/include" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
+	--enable-kernelincl="$(LINUX_SRC_DIR)/include" \
 	--with-ifxos-incl=$(STAGING_DIR)/usr/include/ifxos \
 	$(call autoconf_bool,CONFIG_IFX_DRV_TAPI_EVENT_LOGGER,el-debug) \
 	$(call autoconf_bool,CONFIG_VOICE_CPE_TAPI_FAX,fax t38) \
diff --git a/package/kernel/lantiq/ltq-vdsl-vr11-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-vr11-mei/Makefile
index 7b8a948179..570f806426 100644
--- a/package/kernel/lantiq/ltq-vdsl-vr11-mei/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl-vr11-mei/Makefile
@@ -83,7 +83,7 @@  MEI_DRV_CFLAGS+= \
 	-DMEI_TARGET_x86=1
 
 CONFIGURE_ARGS += \
-	--enable-kernelincl="$(LINUX_DIR)/include" \
+	--enable-kernelincl="$(LINUX_SRC_DIR)/include" \
 	--enable-device=vr11 \
 	--enable-debug \
 	--enable-error_print \
@@ -91,7 +91,7 @@  CONFIGURE_ARGS += \
 	--enable-ifxos-library="-L$(STAGING_DIR)/usr/lib" \
 	--enable-add_drv_cflags="$(MEI_DRV_CFLAGS)" \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
 	--enable-drv_test_appl=yes \
 	ARCH=$(LINUX_KARCH)
 
diff --git a/package/kernel/lantiq/ltq-vdsl-vr11/Makefile b/package/kernel/lantiq/ltq-vdsl-vr11/Makefile
index 11f96d744a..0289ed1e22 100644
--- a/package/kernel/lantiq/ltq-vdsl-vr11/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl-vr11/Makefile
@@ -54,14 +54,14 @@  CONFIGURE_ARGS += \
 	--enable-add_ext_drv_cflags="-DDSL_DRV_ATM_PTM_INTERFACE_ENABLE=1" \
 	--enable-debug-logger-support=no
 
-CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
+CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_SRC_DIR)/include" \
 	--enable-vrx \
 	--enable-vrx-device=vr11 \
 	--enable-ifxos \
 	--enable-ifxos-include="-I$(STAGING_DIR)/usr/include/ifxos" \
 	--enable-driver-include="-I$(STAGING_DIR)/usr/include/vdsl" \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
 	--enable-debug-prints=no \
 	ARCH=$(LINUX_KARCH)
 
diff --git a/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile b/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile
index e9c5a681fd..f78e6255f3 100644
--- a/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl-vr9-mei/Makefile
@@ -66,7 +66,7 @@  MEI_DRV_CFLAGS = \
 	-DMEI_SUPPORT_OPTIMIZED_FW_DL=1
 
 CONFIGURE_ARGS += \
-	--enable-kernelincl="$(LINUX_DIR)/include" \
+	--enable-kernelincl="$(LINUX_SRC_DIR)/include" \
 	--enable-device=vr9 \
 	--with-max-device=1 \
 	--with-lines-per-device=1 \
@@ -76,7 +76,7 @@  CONFIGURE_ARGS += \
 	--enable-ifxos-library="-L$(STAGING_DIR)/usr/lib" \
 	--enable-add_drv_cflags="$(MEI_DRV_CFLAGS)" \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
 	--enable-drv_test_appl=yes \
 	ARCH=$(LINUX_KARCH)
 
diff --git a/package/kernel/lantiq/ltq-vdsl-vr9/Makefile b/package/kernel/lantiq/ltq-vdsl-vr9/Makefile
index ebcb935a73..f580e38778 100644
--- a/package/kernel/lantiq/ltq-vdsl-vr9/Makefile
+++ b/package/kernel/lantiq/ltq-vdsl-vr9/Makefile
@@ -45,7 +45,7 @@  MAKE_FLAGS += \
 	$(KERNEL_MAKE_FLAGS) \
 	SHELL="$(BASH)"
 
-CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
+CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_SRC_DIR)/include" \
 	--with-max-device="1" \
 	--with-lines-per-device="1" \
 	--with-channels-per-line="1" \
@@ -56,7 +56,7 @@  CONFIGURE_ARGS += --enable-kernel-include="$(LINUX_DIR)/include" \
 	--enable-driver-include="-I$(STAGING_DIR)/usr/include/vdsl" \
 	--enable-add-drv-cflags="-DMODULE -DINCLUDE_DSL_ATM_PTM_INTERFACE_SUPPORT" \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
 	--enable-debug-prints=no \
 	ARCH=mips
 
diff --git a/package/kernel/lantiq/ltq-vmmc/Makefile b/package/kernel/lantiq/ltq-vmmc/Makefile
index c96cee819b..55c5688240 100644
--- a/package/kernel/lantiq/ltq-vmmc/Makefile
+++ b/package/kernel/lantiq/ltq-vmmc/Makefile
@@ -45,8 +45,8 @@  MAKE_FLAGS += \
 CONFIGURE_ARGS += \
 	ARCH=$(LINUX_KARCH) \
 	--enable-linux-26 \
-	--enable-kernelbuild="$(LINUX_DIR)" \
-	--enable-kernelincl="$(LINUX_DIR)/include" \
+	--enable-kernelbuild="$(LINUX_OBJ_DIR)" \
+	--enable-kernelincl="$(LINUX_SRC_DIR)/include" \
 	--enable-tapiincl="$(STAGING_DIR)/usr/include/drv_tapi" \
 	--with-ifxos-incl=$(STAGING_DIR)/usr/include/ifxos \
 	$(call autoconf_bool,CONFIG_VOICE_CPE_VMMC_EVENT_LOGGER,el-debug) \
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index c9e2a37f6d..d5e3171f94 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -325,9 +325,9 @@  endif
 ifeq ($(strip $(CONFIG_EXTERNAL_KERNEL_TREE)),"")
   ifeq ($(strip $(CONFIG_KERNEL_GIT_CLONE_URI)),"")
     define Build/Configure
-	  cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_DIR)/include/linux/ath9k_platform.h
-	  cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_DIR)/include/linux/ath5k_platform.h
-	  cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_DIR)/include/linux/rt2x00_platform.h
+	  cmp $(PKG_BUILD_DIR)/include/linux/ath9k_platform.h $(LINUX_SRC_DIR)/include/linux/ath9k_platform.h
+	  cmp $(PKG_BUILD_DIR)/include/linux/ath5k_platform.h $(LINUX_SRC_DIR)/include/linux/ath5k_platform.h
+	  cmp $(PKG_BUILD_DIR)/include/linux/rt2x00_platform.h $(LINUX_SRC_DIR)/include/linux/rt2x00_platform.h
     endef
   endif
 endif
diff --git a/package/network/config/ltq-adsl-app/Makefile b/package/network/config/ltq-adsl-app/Makefile
index 472e3c0ed9..6764d2c77f 100644
--- a/package/network/config/ltq-adsl-app/Makefile
+++ b/package/network/config/ltq-adsl-app/Makefile
@@ -74,7 +74,7 @@  CONFIGURE_ARGS += \
 	--enable-dsl-pm-line-thresholds \
 	--enable-dsl-pm-optional-parameters
 
-TARGET_CFLAGS += -I$(LINUX_DIR)/include
+TARGET_CFLAGS += -I$(LINUX_OBJ_DIR)/include -I$(LINUX_SRC_DIR)/include
 
 define Build/Prepare
 	$(call Build/Prepare/Default)
diff --git a/package/network/services/ppp/Makefile b/package/network/services/ppp/Makefile
index 5f4b8ac02f..5848c9cca0 100644
--- a/package/network/services/ppp/Makefile
+++ b/package/network/services/ppp/Makefile
@@ -183,9 +183,9 @@  $(call Build/Configure/Default,, \
 )
 	mkdir -p $(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux
 	$(CP) \
-		$(LINUX_DIR)/include/linux/compiler.h \
-		$(LINUX_DIR)/include/linux/compiler_types.h \
-		$(LINUX_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \
+		$(LINUX_SRC_DIR)/include/linux/compiler.h \
+		$(LINUX_SRC_DIR)/include/linux/compiler_types.h \
+		$(LINUX_SRC_DIR)/include/$(LINUX_UAPI_DIR)linux/atm*.h \
 		$(PKG_BUILD_DIR)/pppd/plugins/pppoatm/linux/
 endef
 
diff --git a/package/network/utils/iproute2/Makefile b/package/network/utils/iproute2/Makefile
index 7f4556e7d3..5204cb878b 100644
--- a/package/network/utils/iproute2/Makefile
+++ b/package/network/utils/iproute2/Makefile
@@ -177,7 +177,7 @@  TARGET_LDFLAGS += -Wl,--as-needed
 TARGET_CPPFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
 
 MAKE_FLAGS += \
-	KERNEL_INCLUDE="$(LINUX_DIR)/include/uapi" \
+	KERNEL_INCLUDE="$(LINUX_SRC_DIR)/include/uapi" \
 	SHARED_LIBS=$(SHARED_LIBS) \
 	IP_CONFIG_TINY=$(IP_CONFIG_TINY) \
 	BUILD_VARIANT=$(BUILD_VARIANT) \
diff --git a/package/network/utils/ipset/Makefile b/package/network/utils/ipset/Makefile
index b0aac8fe36..a34c25f656 100644
--- a/package/network/utils/ipset/Makefile
+++ b/package/network/utils/ipset/Makefile
@@ -45,7 +45,7 @@  endef
 
 CONFIGURE_ARGS += \
 	--disable-static \
-	--with-kbuild="$(LINUX_DIR)"
+	--with-kbuild="$(LINUX_OBJ_DIR)"
 
 TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed