From f3f4e04636626c93220ee5e3892c211f2a90f713 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 21 Mar 2026 14:59:03 -0700 Subject: [PATCH] Makefile: Detect if sh is present. (#3638) --- scripts/tools.mk | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/scripts/tools.mk b/scripts/tools.mk index fd2da3dd0..7acee1b80 100644 --- a/scripts/tools.mk +++ b/scripts/tools.mk @@ -8,20 +8,24 @@ SILENT?=@ THISDIR:=$(dir $(lastword $(MAKEFILE_LIST))) UNAME:=$(shell uname) -ifeq ($(UNAME),$(filter Linux Darwin MINGW%,$(UNAME))) -CMD_MKDIR=mkdir -p "$(1)" -CMD_RMDIR=rm -r "$(1)" +ifeq ($(UNAME),$(filter Linux Darwin,$(UNAME))) ifeq ($(UNAME),$(filter Darwin,$(UNAME))) OS=darwin -else ifeq ($(UNAME),$(filter MINGW%,$(UNAME))) -OS=windows else OS=linux endif +else ifeq ($(UNAME),$(filter MINGW%,$(UNAME))) +OS=windows +else +OS=windows +endif + +ifneq ($(findstring sh,$(notdir $(SHELL))),) +CMD_MKDIR=mkdir -p "$(1)" +CMD_RMDIR=rm -rf "$(1)" else CMD_MKDIR=cmd /C "if not exist "$(subst /,\,$(1))" mkdir "$(subst /,\,$(1))"" CMD_RMDIR=cmd /C "if exist "$(subst /,\,$(1))" rmdir /S /Q "$(subst /,\,$(1))"" -OS=windows endif SHADERC:="$(THISDIR)../tools/bin/$(OS)/shaderc"