From 3c57b45edef027fe994cd469185f10a04f12dcd7 Mon Sep 17 00:00:00 2001
From: OpenEmbedded <oe.patch@oe>
Date: Sat, 25 Nov 2023 14:39:37 +0000
Subject: [PATCH] fix makefiles for yocto build

---
 drivers/net/wireless/uwe5622/Makefile           | 2 +-
 drivers/net/wireless/uwe5622/unisocwcn/Makefile | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/uwe5622/Makefile b/drivers/net/wireless/uwe5622/Makefile
index d2210439f3cc..09e06defdfcf 100644
--- a/drivers/net/wireless/uwe5622/Makefile
+++ b/drivers/net/wireless/uwe5622/Makefile
@@ -2,7 +2,7 @@ obj-$(CONFIG_RK_WIFI_DEVICE_UWE5622) += unisocwcn/
 obj-$(CONFIG_WLAN_UWE5622)    += unisocwifi/
 obj-$(CONFIG_TTY_OVERY_SDIO)  += tty-sdio/
 
-UNISOCWCN_DIR := $(shell cd $(src)/unisocwcn/ && /bin/pwd)
+UNISOCWCN_DIR := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))unisocwcn
 UNISOC_BSP_INCLUDE := $(UNISOCWCN_DIR)/include
 export UNISOC_BSP_INCLUDE
 
diff --git a/drivers/net/wireless/uwe5622/unisocwcn/Makefile b/drivers/net/wireless/uwe5622/unisocwcn/Makefile
index 939acb5c9274..a582426995ed 100755
--- a/drivers/net/wireless/uwe5622/unisocwcn/Makefile
+++ b/drivers/net/wireless/uwe5622/unisocwcn/Makefile
@@ -129,9 +129,10 @@ ccflags-y += -DCONFIG_WCN_BOOT
 ccflags-y += -DCONFIG_WCN_UTILS
 
 #### include path ######
-ccflags-y += -I$(src)/include/
-ccflags-y += -I$(src)/platform/
-ccflags-y += -I$(src)/platform/rf/
+local_src__ := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
+ccflags-y += -I$(local_src__)include/
+ccflags-y += -I$(local_src__)platform/
+ccflags-y += -I$(local_src__)platform/rf/
 
 #### add cflag for Customer ######
 ### ---------- Hisilicon start ---------- ###
@@ -405,7 +406,7 @@ KDIR ?= $(ANDROID_PRODUCT_OUT)/obj/KERNEL_OBJ
 ARCH ?= arm
 CROSS_COMPILE ?= arm-histbv310-linux-
 
-EXTRA_CFLAGS += -I$(src)/include -D__linux__
+EXTRA_CFLAGS += -I$(local_src__)include -D__linux__
 
 all: $(all_dependencies)
 
