From 9890cbf901ae0b743816075a694d58095de1ad39 Mon Sep 17 00:00:00 2001 From: Vishal Aslot Date: Tue, 10 Oct 2023 13:03:45 +0000 Subject: [PATCH] tegra: hwpm: Update Makefile This patch updates makefile so that it can build correctly under baseos. Bug 4266701 Signed-off-by: Vishal Aslot Change-Id: I4cf842212afb08badb9cb5f7287c1729fc4d1530 Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/2994464 Reviewed-by: Vedashree Vidwans Reviewed-by: Vasuki Shankar Reviewed-by: Seema Khowala GVS: Gerrit_Virtual_Submit --- drivers/tegra/hwpm/Makefile | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/tegra/hwpm/Makefile b/drivers/tegra/hwpm/Makefile index c9d67d9..6a9b460 100644 --- a/drivers/tegra/hwpm/Makefile +++ b/drivers/tegra/hwpm/Makefile @@ -6,7 +6,6 @@ GCOV_PROFILE := y ifeq ($(origin srctree.hwpm), undefined) -# Set HWPM source repo path srctree.hwpm := $(abspath $(shell dirname $(lastword $(MAKEFILE_LIST))))/../../.. endif @@ -14,41 +13,35 @@ endif ifeq ($(CONFIG_TEGRA_OOT_MODULE),m) NVHWPM_OBJ = m +# For OOT builds, set required config flags CONFIG_TEGRA_HWPM_OOT := y ccflags-y += -DCONFIG_TEGRA_HWPM_OOT CONFIG_TEGRA_FUSE_UPSTREAM := y ccflags-y += -DCONFIG_TEGRA_FUSE_UPSTREAM - -LINUXINCLUDE += -I$(srctree.nvconftest) -LINUXINCLUDE += -I$(srctree.hwpm)/include -LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm/include -LINUXINCLUDE += -I$(srctree.hwpm)/drivers/tegra/hwpm +ccflags-y += -I$(srctree.nvconftest) else NVHWPM_OBJ = y +endif ccflags-y += -I$(srctree.hwpm)/include ccflags-y += -I$(srctree.hwpm)/drivers/tegra/hwpm/include ccflags-y += -I$(srctree.hwpm)/drivers/tegra/hwpm -endif - ifeq ($(or $(NV_BUILD_CONFIGURATION_IS_SAFETY),$(CONFIG_TEGRA_LINUX_PROD)),1) -nvhwpm-y := tegra_hwpm_mock.o - +nvhwpm-objs := tegra_hwpm_mock.o else # Add required objects to nvhwpm object variable include $(srctree.hwpm)/drivers/tegra/hwpm/Makefile.hwpm.sources - endif obj-${NVHWPM_OBJ} += nvhwpm.o all: - make -C /lib/modules/$(shell uname -r)/build M=$(PWD) $(ccflags) modules + make -C /lib/modules/$(shell uname -r)/build M=$(PWD) $(ccflags) CONFIG_TEGRA_OOT_MODULE=m modules clean: - make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean + make -C /lib/modules/$(shell uname -r)/build M=$(PWD) CONFIG_TEGRA_OOT_MODULE=m clean