bgfx/scripts/tools.mk
kingscallop 17c9300afd
Allow shaders to be compiled on msys2 (#2539)
Adds support on tools.mk for the msys2 environment. The OS is still
considered windows but the command line tools for mkdir and rmdir
behave as if on linux.

The variable SHADER_TMP on the makefiles also had to be quoted to make
it work on msys2.
2021-06-12 11:36:54 -07:00

30 lines
777 B
Makefile

#
# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
#
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 Darwin,$(UNAME)))
OS=darwin
else ifeq ($(UNAME),$(filter MINGW%,$(UNAME)))
OS=windows
else
OS=linux
endif
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"
GEOMETRYC:="$(THISDIR)../tools/bin/$(OS)/geometryc"
TEXTUREC:="$(THISDIR)../tools/bin/$(OS)/texturec"