From 9eaa638dfeb08ca3ff53946f2e6c9794ab68fc81 Mon Sep 17 00:00:00 2001 From: Laxman Dewangan Date: Thu, 5 Dec 2024 09:24:46 +0000 Subject: [PATCH] nvidia-oot: fix the logic of path of makefile The current makefile path is identified by the lastword of MAKEFILE_LIST. This works fine till none of the makefile is included before using the MAKEFILE_LIST, else the value of the MAKEFILE_LIST get changed with new included makefile path as last word. Fix this by getting the path of current makefile at beginning before including any new makefile path. JIRA TMM-5842 Change-Id: I9d59e0b2f589dfa036d1f43850a05bc71f84aa48 Signed-off-by: Laxman Dewangan Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3262527 GVS: buildbot_gerritrpt Tested-by: Ketan Patil Reviewed-by: Ketan Patil --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 247edd37..a95dd420 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,15 @@ # SPDX-License-Identifier: GPL-2.0 # Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. +this_makefile_path := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST)))) + ifeq ($(CONFIG_TEGRA_KLEAF_BUILD),y) -include $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))/Makefile.kleaf +include $(this_makefile_path)/Makefile.kleaf endif # Include kernel specific config ifneq ($(kernel_name),) -kernel_config := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))/configs/Makefile.config.$(kernel_name) +kernel_config := $(this_makefile_path)/configs/Makefile.config.$(kernel_name) ifneq ($(wildcard $(kernel_config)),) include $(kernel_config) endif @@ -15,7 +17,7 @@ endif # Include system specific config ifneq ($(system_type),) -system_config := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))/configs/Makefile.config.$(system_type) +system_config := $(this_makefile_path)/configs/Makefile.config.$(system_type) ifneq ($(wildcard $(system_config)),) include $(system_config) endif