From 522b18190a260aa35dacfc8a48fc228941841f12 Mon Sep 17 00:00:00 2001 From: Oleksandr Tymoshenko Date: Tue, 11 Nov 2025 23:05:35 +0000 Subject: [PATCH] BaseTools/Tests: Fix clean target SEP variable is only set if PYTHON_COMMAND is undefined but referred regardless. It breaks the clean target for the following scenario: . edksetup.sh # Sets PYTHON_COMMAND make -C BaseTools make -C BaseTools clean This change fixes the use case mentioned above by settings SEP for all build configurations. [ardb: Drop redundant assignment for Windows] Signed-off-by: Oleksandr Tymoshenko --- BaseTools/Tests/GNUmakefile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BaseTools/Tests/GNUmakefile b/BaseTools/Tests/GNUmakefile index 2ff3b77e06..1a89dc76a9 100644 --- a/BaseTools/Tests/GNUmakefile +++ b/BaseTools/Tests/GNUmakefile @@ -7,11 +7,17 @@ all: test +ifeq (Windows, $(findstring Windows,$(OS))) + MAKEROOT := $(shell echo %CD%) + SEP:=$(shell echo \) +else + MAKEROOT := . + SEP:=/ +endif + ifndef PYTHON_COMMAND ifeq (Windows, $(findstring Windows,$(OS))) SHELL := cmd.exe - MAKEROOT := $(shell echo %CD%) - SEP:=$(shell echo \) # # Try using the Python Launcher for Windows to find an interperter. # @@ -36,8 +42,6 @@ ifndef PYTHON_COMMAND endif undefine CHECK_PY else # UNIX - MAKEROOT := . - SEP:=/ PYTHON_COMMAND := $(shell /usr/bin/env python3 -c "import sys; print(sys.executable)") ifdef (,$(wildcard $(PYTHON_COMMAND))) # Make sure the file exists PYTHON_COMMAND := $(shell /usr/bin/env python -c "import sys; print(sys.executable)")