diff mbox series

[10/20,WIP] build: use dtc from $(LINUX_OBJ_DIR)

Message ID f7d3a474b1300823915f9c7ef7e6d91e9de1d29f.1700010292.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
As an executable built from source, the Device-Tree Compiler lives
in the object directory.  Update references to point there.

Signed-off-by: Elliott Mitchell <ehem+openwrt@m5p.com>
---
 include/image-commands.mk                   |  6 +++---
 include/image.mk                            |  2 +-
 include/trusted-firmware-a.mk               |  2 +-
 include/u-boot.mk                           |  2 +-
 package/firmware/layerscape/ls-dpl/Makefile |  2 +-
 target/imagebuilder/Makefile                | 10 +++++-----
 target/linux/bcm4908/image/Makefile         |  6 +++---
 target/linux/ipq40xx/image/generic.mk       |  2 +-
 target/linux/layerscape/image/Makefile      |  2 +-
 target/linux/mediatek/image/filogic.mk      |  2 +-
 target/linux/ramips/image/mt7621.mk         |  2 +-
 11 files changed, 19 insertions(+), 19 deletions(-)
diff mbox series

Patch

diff --git a/include/image-commands.mk b/include/image-commands.mk
index d07c882761..b90881d001 100644
--- a/include/image-commands.mk
+++ b/include/image-commands.mk
@@ -315,7 +315,7 @@  define Build/fit
 		$(if $(DEVICE_DTS_OVERLAY),$(foreach dtso,$(DEVICE_DTS_OVERLAY), -O $(dtso):$(KERNEL_BUILD_DIR)/image-$(dtso).dtbo)) \
 		-c $(if $(DEVICE_DTS_CONFIG),$(DEVICE_DTS_CONFIG),"config-1") \
 		-A $(LINUX_KARCH) -v $(LINUX_VERSION)
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage $(if $(findstring external,$(word 3,$(1))),\
 		-E -B 0x1000 $(if $(findstring static,$(word 3,$(1))),-p 0x1000)) -f $@.its $@.new
 	@mv $@.new $@
 endef
@@ -501,14 +501,14 @@  endef
 define Build/qsdk-ipq-factory-nand
 	$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
 		$@.its ubi $@
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
 	@mv $@.new $@
 endef
 
 define Build/qsdk-ipq-factory-nor
 	$(TOPDIR)/scripts/mkits-qsdk-ipq-image.sh \
 		$@.its hlos $(IMAGE_KERNEL) rootfs $(IMAGE_ROOTFS)
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
 	@mv $@.new $@
 endef
 
diff --git a/include/image.mk b/include/image.mk
index 635fad3584..794b32387d 100644
--- a/include/image.mk
+++ b/include/image.mk
@@ -190,7 +190,7 @@  define Image/BuildDTB/sub
 		-I$(LINUX_DIR)/include/ \
 		-undef -D__DTS__ $(3) \
 		-o $(2).tmp $(1)
-	$(LINUX_DIR)/scripts/dtc/dtc -O dtb \
+	$(LINUX_OBJ_DIR)/scripts/dtc/dtc -O dtb \
 		-i$(dir $(1)) $(4) \
 	$(if $(CONFIG_HAS_DT_OVERLAY_SUPPORT),-@) \
 		-o $(2) $(2).tmp
diff --git a/include/trusted-firmware-a.mk b/include/trusted-firmware-a.mk
index 0c0118e092..60acc5b255 100644
--- a/include/trusted-firmware-a.mk
+++ b/include/trusted-firmware-a.mk
@@ -72,7 +72,7 @@  define Build/Configure/Trusted-Firmware-A
 	$(INSTALL_DIR) $(STAGING_DIR)/usr/include
 endef
 
-DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
+DTC=$(wildcard $(LINUX_OBJ_DIR)/scripts/dtc/dtc)
 
 define Build/Compile/Trusted-Firmware-A
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
diff --git a/include/u-boot.mk b/include/u-boot.mk
index 2b8106410f..8269e6c0ff 100644
--- a/include/u-boot.mk
+++ b/include/u-boot.mk
@@ -88,7 +88,7 @@  define Build/Configure/U-Boot
 		+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) $(UBOOT_CONFIGURE_VARS) oldconfig)
 endef
 
-DTC=$(wildcard $(LINUX_DIR)/scripts/dtc/dtc)
+DTC=$(wildcard $(LINUX_OBJ_DIR)/scripts/dtc/dtc)
 
 define Build/Compile/U-Boot
 	+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
diff --git a/package/firmware/layerscape/ls-dpl/Makefile b/package/firmware/layerscape/ls-dpl/Makefile
index 6c53b45417..5ef802e4f2 100644
--- a/package/firmware/layerscape/ls-dpl/Makefile
+++ b/package/firmware/layerscape/ls-dpl/Makefile
@@ -30,7 +30,7 @@  endef
 
 MAKE_PATH:=config
 MAKE_VARS+= \
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH)
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH)
 
 define Build/InstallDev
 	$(INSTALL_DIR) $(STAGING_DIR_IMAGE)
diff --git a/target/imagebuilder/Makefile b/target/imagebuilder/Makefile
index 3bbadc7204..59698d868c 100644
--- a/target/imagebuilder/Makefile
+++ b/target/imagebuilder/Makefile
@@ -16,7 +16,7 @@  IB_NAME:=$(VERSION_DIST_SANITIZED)-imagebuilder-$(if $(CONFIG_VERSION_FILENAMES)
 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_DTSDIR:=$(patsubst $(TOPDIR)/%,$(PKG_BUILD_DIR)/%,$(LINUX_DIR))/arch/$(LINUX_KARCH)/boot/dts/
+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))
 
 BUNDLER_PATH := $(subst $(space),:,$(filter-out $(TOPDIR)/%,$(subst :,$(space),$(PATH))))
@@ -90,12 +90,12 @@  endif
 	-cp $(LINUX_DIR)/.config $(IB_LDIR)/
 	rm -f $(IB_KDIR)/root.*
 	rm -f $(IB_KDIR)/vmlinux.debug
-	if [ -x $(LINUX_DIR)/scripts/dtc/dtc ]; then \
+	if [ -x $(LINUX_OBJ_DIR)/scripts/dtc/dtc ]; then \
 		$(INSTALL_DIR) $(IB_LDIR)/scripts/dtc; \
-		$(INSTALL_BIN) $(LINUX_DIR)/scripts/dtc/dtc $(IB_LDIR)/scripts/dtc/dtc; \
+		$(INSTALL_BIN) $(LINUX_OBJ_DIR)/scripts/dtc/dtc $(IB_LDIR)/scripts/dtc/dtc; \
 	fi
-	if [ -d $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts ]; then \
-		$(CP) -L $(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts/* $(IB_DTSDIR); \
+	if [ -d $(LINUX_SRC_DIR)/arch/$(LINUX_KARCH)/boot/dts ]; then \
+		$(CP) -L $(LINUX_SRC_DIR)/arch/$(LINUX_KARCH)/boot/dts/* $(IB_DTSDIR); \
 	fi
 	$(SED) 's,^# REVISION:=.*,REVISION:=$(REVISION),g' $(PKG_BUILD_DIR)/include/version.mk
 	$(SED) 's,^# SOURCE_DATE_EPOCH:=.*,SOURCE_DATE_EPOCH:=$(SOURCE_DATE_EPOCH),g' $(PKG_BUILD_DIR)/include/version.mk
diff --git a/target/linux/bcm4908/image/Makefile b/target/linux/bcm4908/image/Makefile
index 5d113919e8..87a3a6cb2e 100644
--- a/target/linux/bcm4908/image/Makefile
+++ b/target/linux/bcm4908/image/Makefile
@@ -17,8 +17,8 @@  define Build/bootfs
 	cat $@ | $(STAGING_DIR_HOST)/bin/lzma e -eos -si -so > $@.tmp
 	mv $@.tmp $@
 	sed -i "s=\$${kernel}=$@=" $(KDIR)/bootfs*.its*
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4908.its $(KDIR)/bootfs-bcm4908.itb
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4912.its $(KDIR)/bootfs-bcm4912.itb
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4908.its $(KDIR)/bootfs-bcm4908.itb
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $(KDIR)/bootfs-bcm4912.its $(KDIR)/bootfs-bcm4912.itb
 endef
 
 define Build/bcm4908asus
@@ -58,7 +58,7 @@  define Build/pkgtb
 	cp pkgtb-$(SOC).its $@.its
 	sed -i "s=\$${bootfs}=$(KDIR)/bootfs-$(SOC).itb=" $@.its
 	sed -i "s=\$${rootfs}=$@.rootfs=" $@.its
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@
 endef
 
 define Device/Default
diff --git a/target/linux/ipq40xx/image/generic.mk b/target/linux/ipq40xx/image/generic.mk
index d79fda3156..2fe3371a6b 100644
--- a/target/linux/ipq40xx/image/generic.mk
+++ b/target/linux/ipq40xx/image/generic.mk
@@ -93,7 +93,7 @@  define Build/qsdk-ipq-factory-nand-askey
 		askey_kernel $@.$1 \
 		askey_fs $(IMAGE_ROOTFS) \
 		ubifs $@
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
 	@mv $@.new $@
 endef
 
diff --git a/target/linux/layerscape/image/Makefile b/target/linux/layerscape/image/Makefile
index 27d64c81a0..f8525a1619 100644
--- a/target/linux/layerscape/image/Makefile
+++ b/target/linux/layerscape/image/Makefile
@@ -63,7 +63,7 @@  define Build/traverse-fit-ls1088
 	-D "TEN64" -n "ten64" -a $(FDT_LOADADDR) -c 1 \
 	-d $(DTB_DIR)/freescale/fsl-ls1088a-rdb.dtb \
 	-D "LS1088ARDB" -n "ls1088ardb" -a $(FDT_LOADADDR) -c 2
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
 	@mv -f $@.new $@
 endef
 
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 0ef3e94575..9d3225f59f 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -86,7 +86,7 @@  endef
 define Build/zyxel-nwa-fit-filogic
 	$(TOPDIR)/scripts/mkits-zyxel-fit-filogic.sh \
 		$@.its $@ "80 e1 ff ff ff ff ff ff ff ff"
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
 	@mv $@.new $@
 endef
 
diff --git a/target/linux/ramips/image/mt7621.mk b/target/linux/ramips/image/mt7621.mk
index 3dd6574bf1..ed6933ff70 100644
--- a/target/linux/ramips/image/mt7621.mk
+++ b/target/linux/ramips/image/mt7621.mk
@@ -170,7 +170,7 @@  endef
 define Build/zyxel-nwa-fit
 	$(TOPDIR)/scripts/mkits-zyxel-fit.sh \
 		$@.its $@ "6b e1 6f e1 ff ff ff ff ff ff"
-	PATH=$(LINUX_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
+	PATH=$(LINUX_OBJ_DIR)/scripts/dtc:$(PATH) mkimage -f $@.its $@.new
 	@mv $@.new $@
 endef