From 23c35a1ea30f1e94a4100735590e4a5417769953 Mon Sep 17 00:00:00 2001 From: Peter0x44 Date: Wed, 9 Feb 2022 15:23:34 +0000 Subject: [PATCH] Fix make clean failing when make finds sh.exe in the PATH on windows Raylib's Makefile uses the cmd.exe builtin command del to delete files for the make clean target, making the bad assumption that the shell used to execute build rules is always cmd.exe. --- src/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Makefile b/src/Makefile index ddac896cb..59971b520 100644 --- a/src/Makefile +++ b/src/Makefile @@ -113,6 +113,12 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP) # ifeq ($(UNAME),Msys) -> Windows ifeq ($(OS),Windows_NT) PLATFORM_OS = WINDOWS + # Make always tries to run build rules under sh.exe by default + # so targets like "make clean" will fail if sh.exe is present in PATH + # this ensures under Windows, build rules are executed using cmd.exe + # see README.W32 of GNU Make for more details + # WARNING: -e flag of make will override this + SHELL = cmd else UNAMEOS = $(shell uname) ifeq ($(UNAMEOS),Linux)