# 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 sardonyx_rendy/shaders/**/*) COMP_SHADERS = $(patsubst sardonyx_rendy/shaders/%,sardonyx_rendy/compiled/%.spv,$(SHADERS)) COMP_DISASMS = $(patsubst sardonyx_rendy/shaders/%,sardonyx_rendy/compiled/%.spvasm,$(SHADERS)) SHADERS_UI=$(wildcard sardonyx_ui/shaders/*) COMP_SHADERS_UI = $(patsubst sardonyx_ui/shaders/%,sardonyx_ui/compiled/%.spv,$(SHADERS_UI)) COMP_DISASMS_UI = $(patsubst sardonyx_ui/shaders/%,sardonyx_ui/compiled/%.spvasm,$(SHADERS_UI)) all: $(COMP_SHADERS) $(COMP_DISASMS) $(COMP_SHADERS_UI) $(COMP_DISASMS_UI) sardonyx_rendy/compiled/%.spv: sardonyx_rendy/shaders/% mkdir -p $(dir $@) $(GLSLC) -MD -c -O -o $@ $< sardonyx_rendy/compiled/%.spvasm: sardonyx_rendy/shaders/% mkdir -p $(dir $@) $(GLSLC) -MD -S -g -O -o $@ $< sardonyx_ui/compiled/%.spv: sardonyx_ui/shaders/% mkdir -p $(dir $@) $(GLSLC) -MD -c -O -o $@ $< sardonyx_ui/compiled/%.spvasm: sardonyx_ui/shaders/% mkdir -p $(dir $@) $(GLSLC) -MD -S -g -O -o $@ $< clean: rm sardonyx_rendy/compiled/**/*.spv sardonyx_rendy/compiled/**/*.spvasm sardonyx_rendy/compiled/**/*.d rm sardonyx_ui/compiled/*.spv sardonyx_ui/compiled/*.spvasm sardonyx_ui/compiled/*.d .PHONY: all clean