-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (32 loc) · 1.11 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
NAME = humanGL
CC = clang++
LIB_GLFW_NAME = glfw-3.2.1
LIB_GLAD_NAME = glad
SRC_PATH = ./src/
OBJ_PATH = ./obj/
LIB_PATH = ./lib/
INC_PATH = ./include/ $(LIB_PATH)$(LIB_GLFW_NAME)/include/ $(LIB_PATH)$(LIB_GLAD_NAME)/include/
CC_FLGS = -std=c++11 #-Werror -Wextra -Wall
CC_LIBS = -lglfw3 -framework AppKit -framework OpenGL -framework IOKit -framework CoreVideo
SRC_NAME = main.cpp utils.cpp Env.cpp Controller.cpp Camera.cpp Renderer.cpp Animator.cpp Skeleton.cpp Bone.cpp \
Model.cpp Shader.cpp matrixUtils.cpp
OBJ_NAME = $(SRC_NAME:.cpp=.o)
LIB_NAME = $(LIB_GLFW_NAME)/src
LIB_SRC_NAME = $(LIB_GLAD_NAME)/src/glad.c
SRC = $(addprefix $(SRC_PATH), $(SRC_NAME))
OBJ = $(addprefix $(OBJ_PATH), $(OBJ_NAME))
INC = $(addprefix -I,$(INC_PATH))
LIB = $(addprefix -L$(LIB_PATH),$(LIB_NAME))
LIB_SRC = $(addprefix $(LIB_PATH),$(LIB_SRC_NAME))
all: $(NAME)
$(NAME): $(OBJ)
$(CC) $(CC_FLGS) $(LIB) $(LIB_SRC) $(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