bgfx/src/makefile

80 lines
2.2 KiB
Makefile
Raw Normal View History

2013-03-18 03:10:50 +04:00
#
2016-03-05 22:03:52 +03:00
# Copyright 2011-2016 Branimir Karadzic. All rights reserved.
2013-03-18 03:10:50 +04:00
# License: http://www.opensource.org/licenses/BSD-2-Clause
#
2016-03-10 04:44:43 +03:00
THISDIR:=$(dir $(lastword $(MAKEFILE_LIST)))
include $(THISDIR)/../scripts/tools.mk
2013-03-18 03:10:50 +04:00
2016-03-10 04:44:43 +03:00
SHADER_TMP = $(TEMP)/tmp
BIN = vs_debugfont.bin.h \
fs_debugfont.bin.h \
vs_clear.bin.h \
fs_clear0.bin.h \
fs_clear1.bin.h \
fs_clear2.bin.h \
fs_clear3.bin.h \
fs_clear4.bin.h \
fs_clear5.bin.h \
fs_clear6.bin.h \
fs_clear7.bin.h \
.PHONY: all
all: $(BIN)
define shader-embedded
@echo [$(<)]
2016-10-06 06:41:25 +03:00
$(SILENT) $(SHADERC) --type $(1) --platform linux -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_glsl
2016-03-10 04:44:43 +03:00
@cat $(SHADER_TMP) > $(@)
-$(SILENT) $(SHADERC) --type $(1) --platform windows -p $(2) -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_dx9
-@cat $(SHADER_TMP) >> $(@)
-$(SILENT) $(SHADERC) --type $(1) --platform windows -p $(3) -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_dx11
-@cat $(SHADER_TMP) >> $(@)
-$(SILENT) $(SHADERC) --type $(1) --platform ios -p metal -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_mtl
-@cat $(SHADER_TMP) >> $(@)
2016-10-06 06:41:25 +03:00
-@echo extern const uint8_t* $(basename $(<))_pssl;>> $(@)
-@echo extern const uint32_t $(basename $(<))_pssl_size;>> $(@)
2016-03-10 04:44:43 +03:00
endef
vs_debugfont.bin.h : vs_debugfont.sc
$(call shader-embedded, v, vs_3_0, vs_4_0_level_9_1)
fs_debugfont.bin.h : fs_debugfont.sc
$(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
vs_clear.bin.h : vs_clear.sc
$(call shader-embedded, v, vs_3_0, vs_4_0_level_9_1)
fs_clear0.bin.h : fs_clear0.sc
$(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
fs_clear1.bin.h : fs_clear1.sc
$(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
fs_clear2.bin.h : fs_clear2.sc
$(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
fs_clear3.bin.h : fs_clear3.sc
$(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
fs_clear4.bin.h : fs_clear4.sc
$(call shader-embedded, f, ps_3_0, ps_4_0)
fs_clear5.bin.h : fs_clear5.sc
$(call shader-embedded, f, ps_3_0, ps_4_0)
fs_clear6.bin.h : fs_clear6.sc
$(call shader-embedded, f, ps_3_0, ps_4_0)
fs_clear7.bin.h : fs_clear7.sc
$(call shader-embedded, f, ps_3_0, ps_4_0)
.PHONY: clean
clean:
@echo Cleaning...
@-rm -vf $(BIN)
.PHONY: rebuild
rebuild: clean all