From ab47c6401e3a7da22a2e9e1f4a2a63144d51e13a Mon Sep 17 00:00:00 2001 From: raysan5 Date: Sat, 12 Feb 2022 17:37:12 +0100 Subject: [PATCH] Reviewed Makefile clean target to use CMD shell on Windows Tested on the following environments: - w64devkit.exe - Windows 10 cmd - Notepad++ NppExec console --- src/Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Makefile b/src/Makefile index 3048f98a4..c63326e10 100644 --- a/src/Makefile +++ b/src/Makefile @@ -36,7 +36,6 @@ # NOTE: Highly recommended to read the raylib Wiki to know how to compile raylib for different platforms # https://github.com/raysan5/raylib/wiki - .PHONY: all clean install uninstall # Define required environment variables @@ -106,6 +105,7 @@ ROOT = $(shell whoami) # By default we suppose we are working on Windows HOST_PLATFORM_OS ?= WINDOWS +PLATFORM_OS ?= WINDOWS # Determine PLATFORM_OS in case PLATFORM_DESKTOP selected ifeq ($(PLATFORM),PLATFORM_DESKTOP) @@ -148,6 +148,12 @@ ifeq ($(PLATFORM),PLATFORM_DRM) endif endif +ifeq ($(PLATFORM_OS),WINDOWS) + # Make uses by default Sh shell, if a different shell is required, it must be specified + # On Windows we set CMD as default shell to allow calling del command on clean target + SHELL := cmd +endif + ifeq ($(PLATFORM),PLATFORM_WEB) # Emscripten required variables EMSDK_PATH ?= C:/emsdk @@ -731,12 +737,6 @@ endif # Clean everything clean: ifeq ($(PLATFORM_OS),WINDOWS) - # Make always tries to run build rules under sh.exe by default - # So if sh.exe is present in the PATH on windows, the del commands will fail - # see README.W32 of GNU Make for more details - # It is not specified earlier in the Makefile, because then cross-compilation - # will also fail. - SHELL = cmd del *.o /s cd $(RAYLIB_RELEASE_PATH) del lib$(RAYLIB_LIB_NAME).a /s