-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (88 loc) · 2.63 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: logan <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/03/13 10:03:24 by logan #+# #+# #
# Updated: 2018/05/28 19:42:07 by ihodge ### ########.fr #
# #
# **************************************************************************** #
NAME = bomberman
LIST = main \
Window \
Time \
ShadingProgram \
Camera \
Sprite2D \
ObjFileArrayExtractor \
ObjFile \
Texture \
Model \
Light \
Particles \
systems \
build_level \
Engine \
MenuState \
GameState \
DeathState \
ParticleExplosion \
Text \
Cells \
powerups \
Effects \
scripts \
SettingState \
PauseState \
Sparkles \
save \
LevelSelectState \
LoreDisplay \
CreditState
SRC_DIR = src
OBJ_DIR = obj
SRC = $(addsuffix .cpp, $(addprefix src/, $(LIST)))
OBJ = $(addsuffix .o, $(addprefix $(OBJ_DIR)/, $(LIST)))
DEP = $(OBJ:%.o=%.d)
CPPFLAGS = -std=c++14 -Wall -Wextra -Werror \
$(shell pkg-config --cflags glfw3 glm) \
-I lib/entt/src \
-I lib/lodepng \
-I lib/irrklang/include \
-g -flto -O3 -march=native \
#-fsanitize=undefined -fsanitize=address
LDFLAGS = -flto -framework OpenGl \
$(shell pkg-config --libs glfw3 glm) \
-L lib/lodepng -llodepng \
-L lib/irrklang -lirrklang -rpath '@executable_path/lib/irrklang' -pthread \
#-fsanitize=undefined -fsanitize=address
all: $(OBJ_DIR) $(NAME)
$(NAME): lib/lodepng/liblodepng.a $(OBJ)
@printf "\e[32;1mLinking.. \e[0m\n"
@clang++ $(LDFLAGS) -o $@ $^
@printf "\e[32;1mCreated:\e[0m %s\n" $(NAME)
$(OBJ_DIR):
@mkdir -p $(OBJ_DIR)
-include $(DEP)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
@printf "\e[34;1mCompiling: \e[0m%s\n" $<
@clang++ $(CPPFLAGS) -MMD -c $< -o $@
lib/lodepng/liblodepng.a: lib/lodepng/lodepng.cpp
@printf "\e[35;1mCompiling Dependency: \e[0m%s\n" $<
@clang++ $(CPPFLAGS) -c -o lib/lodepng/lodepng.o $<
@ar rcs $@ lib/lodepng/lodepng.o
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: fclean all
deps:
@./deps.sh
.PHONY: clean fclean all re docs