-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (23 loc) · 853 Bytes
/
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
include environment
MAIN_DIR = src
SRC_DIR = src/private
INC_DIR = src/public
CC_FLAGS = -std=c++17 -I $(INC_DIR) -I ${USER_PATHS}/include -I $(VULKAN_SDK_PATH)/include
LD_FLAGS = -L ${USER_PATHS}/lib -L $(VULKAN_SDK_PATH)/lib -lglfw.3 -lvulkan
LD_FLAGS_EXT = -Wl, -rpath ${USER_PATHS}/lib
vertShaderSrc = $(shell find shaders -type f -name "*.vert")
vertObjFiles = $(patsubst %.vert, %.vert.spv, $(vertShaderSrc))
fragShaderSrc = $(shell find shaders -type f -name "*.frag")
fragObjFiles = $(patsubst %.frag, %.frag.spv, $(fragShaderSrc))
TARGET = a.out
$(TARGET): $(vertObjFiles) $(fragObjFiles)
$(TARGET): $(SRC_DIR)/*.cpp $(INC_DIR)/*.hpp
g++ $(CC_FLAGS) -o ${TARGET} $(MAIN_DIR)/*.cpp $(SRC_DIR)/*.cpp $(LD_FLAGS) $(LD_FLAGS_EXT)
%.spv: %
${GLSLC} $< -o $@
.PHONY: test clean
test: a.out
./a.out
clean:
rm -f a.out
rm -f shaders/*.spv