-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
74 lines (58 loc) · 1.29 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
NAME = shader_pixel
LIST = main \
Window \
Time \
ShadingProgram \
FPSDisplay \
FreeCamera \
SkyBox \
Texture \
Text \
ObjRender \
ShaderObj \
Light \
Transparency \
RenderTarget \
PostProcess
OBJ_DIR = obj
VPATH = src
SRC = $(addsuffix .cpp, $(LIST))
OBJ = $(addsuffix .o, $(addprefix $(OBJ_DIR)/, $(LIST)))
DEP = $(OBJ:%.o=%.d)
MAKEFLAGS=-j4
CPPFLAGS = -std=c++14 -Wall -Wextra -Werror -Wno-unused-parameter \
-Wno-unused-variable \
$(shell pkg-config --cflags glfw3 glm) \
-I lib/stb -I lib/tiny_obj_loader \
-g -O3 -march=native \
#-fsanitize=address -fsanitize=undefined
LDFLAGS = -framework OpenGl \
$(shell pkg-config --libs glfw3 glm) \
-pipe \
#-fsanitize=address -fsanitize=undefined
all: $(OBJ_DIR) $(NAME)
$(OBJ_DIR):
@mkdir -p $(OBJ_DIR)
-include $(DEP)
$(OBJ_DIR)/%.o: %.cpp
@printf "\e[34;1mCompiling: \e[0m%s\n" $<
@clang++ $(CPPFLAGS) -MMD -c $< -o $@
$(NAME): $(OBJ)
@echo "\033[32;1mLinking.. \033[0m"
@clang++ $(LDFLAGS) -o $@ $^
@echo "\033[32;1mCreated:\033[0m "$(NAME)
clean:
@printf "\e[31;1mCleaning..\e[0m\n"
@rm -f $(OBJ)
@rm -f lib/lodepng/lodepng.o
fclean:
@printf "\e[31;1mFull Cleaning..\e[0m\n"
@rm -rf $(OBJ_DIR)
@rm -f $(NAME)
@rm -f lib/lodepng/liblodepng.a
re:
@$(MAKE) fclean 2>/dev/null
@$(MAKE) 2>/dev/null
deps:
@./deps.sh
.PHONY: clean fclean all re