From 7ebe440eb45335de8a2cc69b36b4ce8c6093210e Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Mon, 12 Sep 2022 06:40:28 +0000 Subject: [PATCH] device-tree/Makefile: Tune relative path The relative path from the device-tree/platform to $TOP varies between local and GVS build. The folder "nvidia" in out folder is introduced in the local build which is not there in the GVs build. Check the relative path of $TOP and adjust accordingly. Bug 3787936 Change-Id: I5a34e64a8903f662153c361c2fc7e3ee432d6c14 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2775081 Reviewed-by: Bitan Biswas GVS: Gerrit_Virtual_Submit --- device-tree/platform/Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/device-tree/platform/Makefile b/device-tree/platform/Makefile index 949deaf0..53108717 100644 --- a/device-tree/platform/Makefile +++ b/device-tree/platform/Makefile @@ -17,8 +17,15 @@ DTC_CPP_FLAGS += -DLINUX_VERSION=504 -DTEGRA_HOST1X_DT_VERSION=1 tegra-dtstree := $(TOP)/hardware/nvidia -# From out/l4t-t186ref-debug-aarch64/nvidia/kernel-nvidia-oot/nvidia-oot/device-tree/platform -tegra-rel-dtstree := ../../../../../../../hardware/nvidia +# Get relative path for tegra-dtstree from this makefile +null := +space :=$(null) $(null) +obj-path := $(obj) +obj-path-from-top := $(subst $(TOP),,$(obj-path)) +rel-top-path := $(subst /, $(space)/,$(obj-path-from-top)) +rel-top-path := $(patsubst /%,../,$(rel-top-path)) +rel-top-path := $(subst $(space),,$(rel-top-path)) +tegra-rel-dtstree := $(rel-top-path)/hardware/nvidia DTC_INCLUDE := # SOC independent common include