From e50b586ed6d069345994dd160a6adeb934c4eb3a Mon Sep 17 00:00:00 2001 From: Grant Erickson Date: Wed, 22 Mar 2023 10:38:45 -0700 Subject: [PATCH 1/2] Address issues with WLAN_ROOT. 1. Default 'WLAN_ROOT' to 'PWD'; however, allow it to be overridden externally before passing through to KBUILD_OPTIONS. 2. Do not requalify 'WLAN_ROOT' with 'PWD' in 'LICENSE_FILE' when it already defaults to 'PWD'. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f78d774f5..26f2d8667 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,14 @@ KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build -KBUILD_OPTIONS := WLAN_ROOT=$(PWD) +WLAN_ROOT ?= $(PWD) + +KBUILD_OPTIONS := WLAN_ROOT=$(WLAN_ROOT) KBUILD_OPTIONS += MODNAME?=wlan # Determine if the driver license is Open source or proprietary # This is determined under the assumption that LICENSE doesn't change. # Please change here if driver license text changes. -LICENSE_FILE ?= $(PWD)/$(WLAN_ROOT)/CORE/HDD/src/wlan_hdd_main.c +LICENSE_FILE ?= $(WLAN_ROOT)/CORE/HDD/src/wlan_hdd_main.c WLAN_OPEN_SOURCE = $(shell if grep -q "MODULE_LICENSE(\"Dual BSD/GPL\")" \ $(LICENSE_FILE); then echo 1; else echo 0; fi) From 48b7459e445a742139246f1c4bc452af550df656 Mon Sep 17 00:00:00 2001 From: Grant Erickson Date: Fri, 24 Mar 2023 14:21:03 -0700 Subject: [PATCH 2/2] Use CURDIR rather than PWD as the default for WLAN_ROOT. When make is invoked with '-C' from a directory other than the root of the project source tree, the value of PWD will be the directory where make was invoked. Consequently, it is only correct if and only if make is invoked from the project source tree. However, the make built-in variable CURDIR is always the directory of the current makefile, regardless of where make was invoked from and the '-C' option. --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 26f2d8667..45372a3d9 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build -WLAN_ROOT ?= $(PWD) +WLAN_ROOT ?= $(CURDIR) KBUILD_OPTIONS := WLAN_ROOT=$(WLAN_ROOT) KBUILD_OPTIONS += MODNAME?=wlan