makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #
  2. # Copyright 2011-2016 Branimir Karadzic. All rights reserved.
  3. # License: http://www.opensource.org/licenses/BSD-2-Clause
  4. #
  5. THISDIR:=$(dir $(lastword $(MAKEFILE_LIST)))
  6. include $(THISDIR)/../scripts/tools.mk
  7. SHADER_TMP = $(TEMP)/tmp
  8. BIN = vs_debugfont.bin.h \
  9. fs_debugfont.bin.h \
  10. vs_clear.bin.h \
  11. fs_clear0.bin.h \
  12. fs_clear1.bin.h \
  13. fs_clear2.bin.h \
  14. fs_clear3.bin.h \
  15. fs_clear4.bin.h \
  16. fs_clear5.bin.h \
  17. fs_clear6.bin.h \
  18. fs_clear7.bin.h \
  19. .PHONY: all
  20. all: $(BIN)
  21. define shader-embedded
  22. @echo [$(<)]
  23. $(SILENT) $(SHADERC) --type $(1) --platform linux -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_glsl
  24. @cat $(SHADER_TMP) > $(@)
  25. -$(SILENT) $(SHADERC) --type $(1) --platform windows -p $(2) -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_dx9
  26. -@cat $(SHADER_TMP) >> $(@)
  27. -$(SILENT) $(SHADERC) --type $(1) --platform windows -p $(3) -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_dx11
  28. -@cat $(SHADER_TMP) >> $(@)
  29. -$(SILENT) $(SHADERC) --type $(1) --platform ios -p metal -O 3 -f $(<) -o $(SHADER_TMP) --bin2c $(basename $(<))_mtl
  30. -@cat $(SHADER_TMP) >> $(@)
  31. endef
  32. vs_debugfont.bin.h : vs_debugfont.sc
  33. $(call shader-embedded, v, vs_3_0, vs_4_0_level_9_1)
  34. fs_debugfont.bin.h : fs_debugfont.sc
  35. $(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
  36. vs_clear.bin.h : vs_clear.sc
  37. $(call shader-embedded, v, vs_3_0, vs_4_0_level_9_1)
  38. fs_clear0.bin.h : fs_clear0.sc
  39. $(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
  40. fs_clear1.bin.h : fs_clear1.sc
  41. $(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
  42. fs_clear2.bin.h : fs_clear2.sc
  43. $(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
  44. fs_clear3.bin.h : fs_clear3.sc
  45. $(call shader-embedded, f, ps_3_0, ps_4_0_level_9_1)
  46. fs_clear4.bin.h : fs_clear4.sc
  47. $(call shader-embedded, f, ps_3_0, ps_4_0)
  48. fs_clear5.bin.h : fs_clear5.sc
  49. $(call shader-embedded, f, ps_3_0, ps_4_0)
  50. fs_clear6.bin.h : fs_clear6.sc
  51. $(call shader-embedded, f, ps_3_0, ps_4_0)
  52. fs_clear7.bin.h : fs_clear7.sc
  53. $(call shader-embedded, f, ps_3_0, ps_4_0)
  54. .PHONY: clean
  55. clean:
  56. @echo Cleaning...
  57. @-rm -vf $(BIN)
  58. .PHONY: rebuild
  59. rebuild: clean all