-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (24 loc) · 705 Bytes
/
Makefile
File metadata and controls
35 lines (24 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
PROG = clown
SRCS := $(shell find . -name "*.cpp")
OBJS := $(SRCS:%=%.o)
DEPS := $(OBJS:.o=.d)
SHADERS := $(wildcard shaders/*.vert shaders/*.frag)
SPIRVS := $(addsuffix .spv, $(SHADERS))
CFLAGS = -std=c++17 -I$(VULKAN_SDK)/include
LDFLAGS = -g -L$(VULKAN_SDK)/lib `pkg-config --static --libs glfw3` -lvulkan
CC := g++
$(PROG): $(OBJS)
$(CC) $(OBJS) -o $@ $(LDFLAGS)
%.cpp.o: %.cpp
$(CC) -MMD -MP $(CFLAGS) -c $< -o $@ $(LDFLAGS)
$(SPIRVS): %.spv: %
glslc $< -o $@
.PHONY: clean
clean:
find . -type f -name '*.o' -delete
find . -type f -name '*.d' -delete
find . -type f -name 'vgcore.*' -delete
find . -type f -name '*.spv' -delete
.PHONY: shaders
shaders: $(SPIRVS)
-include $(DEPS)