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 <ovt@google.com>
This commit is contained in:
Oleksandr Tymoshenko 2025-11-11 23:05:35 +00:00 committed by mergify[bot]
parent f5f4e9b764
commit 522b18190a

View file

@ -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)")