Files
Cheap-Vulkan-Renderer/Makefile

39 lines
778 B
Makefile

CXX ?= g++
CCACHE := $(shell command -v ccache 2>/dev/null)
ifneq ($(CCACHE),)
CXX := ccache $(CXX)
endif
CXXFLAGS = -std=c++17 -O2 -MMD -MP
LDFLAGS = -lglfw -lvulkan -ldl -lpthread -lX11 -lXxf86vm -lXrandr -lXi
SOURCES = $(wildcard *.cpp)
HEADERS = $(wildcard *.hpp)
OBJECTS = $(SOURCES:%.cpp=build/%.o)
DEPS = $(OBJECTS:.o=.d)
SHADERS = shaders/simple_shader.vert shaders/simple_shader.frag
SPV = $(SHADERS:=.spv)
VulkanTest: $(SPV) $(OBJECTS)
$(CXX) $(CXXFLAGS) -o VulkanTest $(OBJECTS) $(LDFLAGS)
build/%.o: %.cpp $(HEADERS) | build
$(CXX) $(CXXFLAGS) -c $< -o $@
shaders/%.spv: shaders/%
/usr/local/bin/glslc $< -o $@
build:
mkdir -p build
.PHONY: test clean
test: VulkanTest
./VulkanTest
clean:
rm -f VulkanTest
rm -rf build
rm -f $(SPV)
-include $(DEPS)