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 <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3262527
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Tested-by: Ketan Patil <ketanp@nvidia.com>
Reviewed-by: Ketan Patil <ketanp@nvidia.com>
This commit is contained in:
Laxman Dewangan
2024-12-05 09:24:46 +00:00
committed by Jon Hunter
parent 6af855f1d0
commit 9eaa638dfe

View File

@@ -1,13 +1,15 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2022-2024, NVIDIA CORPORATION. All rights reserved.
this_makefile_path := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))
ifeq ($(CONFIG_TEGRA_KLEAF_BUILD),y) ifeq ($(CONFIG_TEGRA_KLEAF_BUILD),y)
include $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))/Makefile.kleaf include $(this_makefile_path)/Makefile.kleaf
endif endif
# Include kernel specific config # Include kernel specific config
ifneq ($(kernel_name),) 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)),) ifneq ($(wildcard $(kernel_config)),)
include $(kernel_config) include $(kernel_config)
endif endif
@@ -15,7 +17,7 @@ endif
# Include system specific config # Include system specific config
ifneq ($(system_type),) 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)),) ifneq ($(wildcard $(system_config)),)
include $(system_config) include $(system_config)
endif endif