From 0accaa46463a2c4e3ad43b4a390a6667e19c9ebb Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Fri, 20 Dec 2013 23:03:12 -0800 Subject: [PATCH] Updated shader makefiles to use platform specific path for tools. --- premake/shader-embeded.mk | 15 ++++++++++++++- premake/shader.mk | 29 +++++++++++++++++++---------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/premake/shader-embeded.mk b/premake/shader-embeded.mk index d6e29230..d9e014cd 100644 --- a/premake/shader-embeded.mk +++ b/premake/shader-embeded.mk @@ -8,9 +8,22 @@ SILENT = @ endif THISDIR := $(dir $(lastword $(MAKEFILE_LIST))) + +UNAME := $(shell uname) +ifeq ($(UNAME),$(filter $(UNAME),Linux)) +OS=linux +else +ifeq ($(UNAME),$(filter $(UNAME),Darwin)) +OS=darwin +else +OS=windows +endif +endif + +SHADERC="$(THISDIR)../tools/bin/$(OS)/shaderc" + VS_FLAGS+=-i $(THISDIR)../src/ --type vertex FS_FLAGS+=-i $(THISDIR)../src/ --type fragment -SHADERC="$(THISDIR)../tools/bin/shaderc" VS_SOURCES=$(wildcard vs_*.sc) FS_SOURCES=$(wildcard fs_*.sc) diff --git a/premake/shader.mk b/premake/shader.mk index dffcd26c..14e069b3 100644 --- a/premake/shader.mk +++ b/premake/shader.mk @@ -18,7 +18,25 @@ all: @echo " TARGET=4 (glsl - linux)" @echo " VERBOSE=1 show build commands." else -SHADERC="$(BGFX_DIR)/tools/bin/shaderc" + +THISDIR := $(dir $(lastword $(MAKEFILE_LIST))) + +UNAME := $(shell uname) +ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin)) +CMD_MKDIR=mkdir -p "$(1)" +CMD_RMDIR=rm -r "$(1)" +ifeq ($(UNAME),$(filter $(UNAME),Darwin)) +OS=darwin +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" ifeq ($(TARGET), 0) VS_FLAGS=--platform windows -p vs_3_0 -O 3 @@ -63,15 +81,6 @@ VS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $( FS_SOURCES=$(wildcard fs_*.sc) FS_DEPS=$(addprefix $(BUILD_INTERMEDIATE_DIR)/,$(addsuffix .bin.d, $(basename $(FS_SOURCES)))) -UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin)) -CMD_MKDIR=mkdir -p "$(1)" -CMD_RMDIR=rm -r "$(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))"" -endif - VS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(VS_SOURCES)))) FS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(FS_SOURCES))))