From 6993dfcfb0ebe369f246ff50e3669d4557a527da Mon Sep 17 00:00:00 2001 From: Bart Trzynadlowski Date: Tue, 28 Mar 2023 15:38:43 -0700 Subject: [PATCH] Makefile.Win32: fixed detection of Windows Command Prompt for rmdir command --- Makefiles/Makefile.Win32 | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Makefiles/Makefile.Win32 b/Makefiles/Makefile.Win32 index 6cdb5cf..f620373 100644 --- a/Makefiles/Makefile.Win32 +++ b/Makefiles/Makefile.Win32 @@ -70,11 +70,13 @@ ifneq ($(filter $(strip $(BITS)),32 64),$(strip $(BITS))) endif # -# Use Bash or Windows Prompt shell commands? +# Use Bash or Windows Command Prompt shell commands? # -DELETE = rm -d -r -f -ifeq ($(strip $(MSYSTEM)),1) - DELETE = rmdir /s /q +ifneq (,$(findstring cmd.exe,$(shell echo %COMSPEC%))) + # 'echo %COMSPEC%' returns path to cmd.exe on Windows, '%COMSPEC%' in bash + RMDIR = rmdir /s /q +else + RMDIR = rm -d -r -f endif # @@ -113,8 +115,8 @@ include Makefiles/Rules.inc clean: $(SILENT)echo Cleaning up $(BIN_DIR) and $(OBJ_DIR)... - $(SILENT)$(DELETE) $(BIN_DIR) - $(SILENT)$(DELETE) $(OBJ_DIR) + $(SILENT)$(RMDIR) $(BIN_DIR) + $(SILENT)$(RMDIR) $(OBJ_DIR) ###############################################################################