BIN = target/debug/mineclone

SHADERS = $(shell find shaders -name '*.frag' -or -name '*.vert' | sed -e 's/\.frag/_frag.spv/' -e 's/\.vert/_vert.spv/')
SOURCES = $(shell find src -name '*.rs')

all: $(SHADERS) $(BIN)

run: all
	cargo run

$(BIN): $(SOURCES)
	cargo build

%_vert.spv: %.vert
	glslc $< -o $@

%_frag.spv: %.frag
	glslc $< -o $@
