SPIRV-Cross/samples/cpp/Makefile

29 lines
610 B
Makefile
Raw Normal View History

2016-05-24 19:38:42 +00:00
SOURCES := $(wildcard *.comp)
SPIRV := $(SOURCES:.comp=.spv)
CPP_INTERFACE := $(SOURCES:.comp=.spv.cpp)
CPP_DRIVER := $(SOURCES:.comp=.cpp)
EXECUTABLES := $(SOURCES:.comp=.shader)
OBJECTS := $(CPP_DRIVER:.cpp=.o) $(CPP_INTERFACE:.cpp=.o)
CXXFLAGS += -std=c++11 -I../../include -I.
LDFLAGS += -pthread -lm
all: $(EXECUTABLES)
%.spv: %.comp
glslangValidator -V -o $@ $<
%.spv.cpp: %.spv
../../spirv-cross --cpp --output $@ $<
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
%.shader: %.o %.spv.o
$(CXX) -o $@ $^ $(LDFLAGS)
clean:
$(RM) -f $(EXECUTABLES) $(SPIRV) $(CPP_INTERFACE) $(OBJECTS)
.PHONY: clean