26 lines
728 B
Makefile
26 lines
728 B
Makefile
CFLAGS = -std=c++17 -o2 -I. -I$(VULKAN_SDK_PATH)/include
|
|
LDFLAGS = -L$(VULKAN_SDK_PATH)/lib `pkg-config --static --libs glfw3` -lvulkan -ldl -lpthread -lX11 -lXrandr -lXi
|
|
|
|
# create list of all spv files and set as dependency
|
|
vertSources = $(shell find ./shaders -type f -name "*.vert")
|
|
vertSpvs = $(patsubst %.vert, %.vert.spv, $(vertSources))
|
|
fragSources = $(shell find ./shaders -type f -name "*.frag")
|
|
fragSpvs = $(patsubst %.frag, %.frag.spv, $(fragSources))
|
|
|
|
TARGET = VulkanTest
|
|
$(TARGET): $(vertSpvs) $(fragSpvs)
|
|
$(TARGET): *.cpp *.hpp
|
|
g++ $(CFLAGS) -o $(TARGET) *.cpp $(LDFLAGS)
|
|
|
|
# make shader targets
|
|
%.spv: %
|
|
${GLSLC} $< -o $@
|
|
|
|
.PHONY: test clean
|
|
|
|
test: VulkanTest
|
|
./VulkanTest
|
|
|
|
clean:
|
|
rm -f VulkanTest
|
|
rm -f *.spv
|