forked from amethyst/amethyst
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
40 lines (30 loc) · 1.34 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# This Makefile is meant for shader compilation only.
# Use cargo to compile the rust part of the project.
GLSLC = $(shell ./find_glslc.sh)
ifeq "$(GLSLC)" ""
break;
endif
FLAGS = -c -g
SHADERS=$(wildcard amethyst_rendy/shaders/**/*)
COMP_SHADERS = $(patsubst amethyst_rendy/shaders/%,amethyst_rendy/compiled/%.spv,$(SHADERS))
COMP_DISASMS = $(patsubst amethyst_rendy/shaders/%,amethyst_rendy/compiled/%.spvasm,$(SHADERS))
SHADERS_UI=$(wildcard amethyst_ui/shaders/*)
COMP_SHADERS_UI = $(patsubst amethyst_ui/shaders/%,amethyst_ui/compiled/%.spv,$(SHADERS_UI))
COMP_DISASMS_UI = $(patsubst amethyst_ui/shaders/%,amethyst_ui/compiled/%.spvasm,$(SHADERS_UI))
all: $(COMP_SHADERS) $(COMP_DISASMS) $(COMP_SHADERS_UI) $(COMP_DISASMS_UI)
amethyst_rendy/compiled/%.spv: amethyst_rendy/shaders/%
mkdir -p $(dir $@)
$(GLSLC) -MD -c -O -o $@ $<
amethyst_rendy/compiled/%.spvasm: amethyst_rendy/shaders/%
mkdir -p $(dir $@)
$(GLSLC) -MD -S -g -O -o $@ $<
amethyst_ui/compiled/%.spv: amethyst_ui/shaders/%
mkdir -p $(dir $@)
$(GLSLC) -MD -c -O -o $@ $<
amethyst_ui/compiled/%.spvasm: amethyst_ui/shaders/%
mkdir -p $(dir $@)
$(GLSLC) -MD -S -g -O -o $@ $<
clean:
rm amethyst_rendy/compiled/**/*.spv amethyst_rendy/compiled/**/*.spvasm amethyst_rendy/compiled/**/*.d
rm amethyst_ui/compiled/*.spv amethyst_ui/compiled/*.spvasm amethyst_ui/compiled/*.d
.PHONY: all clean