Makefile: Detect if sh is present. (#3638)

This commit is contained in:
Branimir Karadžić
2026-03-21 14:59:03 -07:00
committed by GitHub
parent 0499759e8c
commit f3f4e04636

View File

@@ -8,20 +8,24 @@ SILENT?=@
THISDIR:=$(dir $(lastword $(MAKEFILE_LIST))) THISDIR:=$(dir $(lastword $(MAKEFILE_LIST)))
UNAME:=$(shell uname) UNAME:=$(shell uname)
ifeq ($(UNAME),$(filter Linux Darwin MINGW%,$(UNAME))) ifeq ($(UNAME),$(filter Linux Darwin,$(UNAME)))
CMD_MKDIR=mkdir -p "$(1)"
CMD_RMDIR=rm -r "$(1)"
ifeq ($(UNAME),$(filter Darwin,$(UNAME))) ifeq ($(UNAME),$(filter Darwin,$(UNAME)))
OS=darwin OS=darwin
else ifeq ($(UNAME),$(filter MINGW%,$(UNAME)))
OS=windows
else else
OS=linux OS=linux
endif 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 else
CMD_MKDIR=cmd /C "if not exist "$(subst /,\,$(1))" mkdir "$(subst /,\,$(1))"" 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))"" CMD_RMDIR=cmd /C "if exist "$(subst /,\,$(1))" rmdir /S /Q "$(subst /,\,$(1))""
OS=windows
endif endif
SHADERC:="$(THISDIR)../tools/bin/$(OS)/shaderc" SHADERC:="$(THISDIR)../tools/bin/$(OS)/shaderc"