From 48002b010188b35e6d35531f990b8004f1ddd021 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 --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 949deaf..5310871 100644 --- a/Makefile +++ b/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