-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (28 loc) · 1.13 KB
/
Makefile
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
36
37
38
39
40
41
42
43
VULKAN_SDK_PATH = /home/filip/Vulkan/1.1.121.1/x86_64
name = SimulacijaTkanine
srcFiles = $(shell find src/ -name '*.cpp')
headerfiles = $(shell find src/ -name '*.h')
objects = $(srcFiles:.cpp=.o)
depends = $(srcFiles:.cpp=.d)
shaderFiles = $(shell find shaders/ -name '*.glsl')
shaderObjects = $(shaderFiles:.glsl=.spv)
CFLAGS = -std=c++17 -I$(VULKAN_SDK_PATH)/include
LDFLAGS = -L$(VULKAN_SDK_PATH)/lib `pkg-config --static --libs glfw3` -lvulkan -lpthread
SCENE ?= 1
POINTS ?= 10
.PHONY: all clean
all: $(name) shaders
clean:
rm -f $(name) $(shaderObjects) $(objects) $(depends)
$(name): $(objects)
g++ -g -DDEBUG $(CFLAGS) -o $(name) $(objects) $(LDFLAGS)
shaders/%.spv: shaders/%.glsl
$(VULKAN_SDK_PATH)/bin/glslangValidator -V $< -o $@
test: all
LD_LIBRARY_PATH=$(VULKAN_SDK_PATH)/lib VK_LAYER_PATH=$(VULKAN_SDK_PATH)/etc/vulkan/explicit_layer.d ./$(name) $(SCENE) $(POINTS)
debug: all
LD_LIBRARY_PATH=$(VULKAN_SDK_PATH)/lib VK_LAYER_PATH=$(VULKAN_SDK_PATH)/etc/vulkan/explicit_layer.d gdb ./$(name) $(SCENE) $(POINTS)
shaders: $(shaderObjects)
-include $(depends)
src/%.o: src/%.cpp
g++ -g -DDEBUG $(CFLAGS) -MMD -MP -c -o $@ $<