-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (40 loc) · 1.38 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
44
45
46
47
48
49
50
51
NAME = shaderPixel
CC = clang++
LIB_GLFW_NAME = .glfw-3.2.1
LIB_GLAD_NAME = .glad
LIB_GLM_NAME = .glm
LIB_ASSIMP_NAME = .assimp-4.1.0
SRC_PATH = ./src/
OBJ_PATH = ./obj/
LIB_PATH = $(HOME)/
INC_PATH = ./include/ \
./lib/ \
$(LIB_PATH)$(LIB_GLFW_NAME)/include/ \
$(LIB_PATH)$(LIB_GLAD_NAME)/include/ \
$(LIB_PATH)$(LIB_GLM_NAME)/ \
$(LIB_PATH)$(LIB_ASSIMP_NAME)/include/ \
/usr/local/Cellar/opencv/3.4.2/include
CC_FLGS = -std=c++11 -Ofast
CC_LIBS = -lassimp -lglfw3 -framework AppKit -framework OpenGL -framework IOKit -framework CoreVideo \
-lopencv_core -lopencv_videoio -lopencv_imgproc
SRC_NAME = main.cpp Raymarched.cpp Light.cpp Mesh.cpp Model.cpp Camera.cpp Controller.cpp Env.cpp \
Renderer.cpp Shader.cpp utils.cpp VideoCapture.cpp RaymarchedSurface.cpp
OBJ_NAME = $(SRC_NAME:.cpp=.o)
SRC = $(addprefix $(SRC_PATH), $(SRC_NAME))
OBJ = $(addprefix $(OBJ_PATH), $(OBJ_NAME))
INC = $(addprefix -I,$(INC_PATH))
LIB_GLFW = -L $(LIB_PATH)$(LIB_GLFW_NAME)/src
LIB_GLAD = $(LIB_PATH)$(LIB_GLAD_NAME)/src/glad.c
LIB_ASSIMP = -L $(LIB_PATH)$(LIB_ASSIMP_NAME)/lib
all: $(NAME)
$(NAME): $(OBJ)
$(CC) $(CC_FLGS) $(LIB_GLFW) $(LIB_GLAD) $(LIB_ASSIMP) $(INC) $(OBJ) $(CC_LIBS) -o $(NAME)
$(OBJ_PATH)%.o: $(SRC_PATH)%.cpp
mkdir -p $(OBJ_PATH)
$(CC) $(CC_FLGS) $(INC) -o $@ -c $<
clean:
rm -fv $(OBJ)
rm -rf $(OBJ_PATH)
fclean: clean
rm -fv $(NAME)
re: fclean all