-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
141 lines (120 loc) · 3.35 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
##
## EPITECH PROJECT, 2020
## Makefile
## File description:
## Any C-SFML Project Makefile
##
# GCC ARGS HELPER
# -Werror = Make all warnings into errors
# -Wall = show all warnings flags
# -Wextra = show all extra warnings flags
# -Wno-unused = remove unused things warning
#
# DEBUG :
# 0 : Don't compile with g3 and allow warnings
# 1 : Compile with g3 and allow warnings
# 2 : Compile with g3 and don't allow warnings
DEBUG = 0
MATH = 1
PROJECT_SRC = ./src/main.c \
./src/game.c \
./src/game_more.c \
./src/window.c \
./src/game_event.c \
./src/font.c \
./src/camera/camera.c \
./src/camera/camera_transition.c \
./src/utils/sfml_extra.c \
./src/utils/sfml_extra_more.c \
./src/utils/config_core.c \
./src/utils/config_manager.c \
./src/utils/config_rpg.c \
./src/player/player.c \
./src/player/player_more.c \
./src/player/player_life_hud.c \
./src/player/player_camera_hud.c \
./src/player/player_camera_hud_more.c \
./src/map/map.c \
./src/map/map_more.c \
./src/entity/entity.c \
./src/entity/entity_more.c \
./src/entity/type/medic.c \
./src/entity/type/enemy.c \
./src/entity/type/enemy_more.c \
./src/music/music.c \
./src/music/music_more.c \
./src/music/sound.c \
./src/music/sound_more.c \
./src/building/building.c \
./src/building/building_more.c \
./src/building/type/tree.c \
./src/building/type/rock.c \
./src/building/type/mountains.c \
./src/building/type/door.c \
./src/building/type/key.c \
./src/building/type/key_more.c \
./src/particule/particule.c \
./src/particule/particule_more.c \
./src/particule/type/heal.c \
./src/particule/type/heal_more.c \
./src/menu/menu.c \
./src/menu/pause_menu.c \
./src/menu/pause_more.c \
./src/menu/main_menu.c \
./src/menu/main_menu_more.c \
./src/menu/settings_menu.c \
./src/menu/settings_menu_more.c \
./src/menu/inventory_menu.c \
./src/menu/inventory_menu_more.c \
./src/menu/htp_menu.c \
./src/button/button.c \
./src/button/button_more.c \
./src/button/button_event.c
PROJECT_OBJ = $(PROJECT_SRC:.c=.o)
NAME_LIB = teklibc.a
NAME = my_rpg
CPPFLAGS += -I./include
CFLAGS += -Wall -Wextra
CSFML_ARGS = -lcsfml-graphics -lcsfml-system -lcsfml-window -lcsfml-audio
ifeq ($(MATH), 1)
GCC_ARGS += -lm
CFLAGS += -lm -Wno-unused
endif
ifeq ($(DEBUG), 1)
GCC_ARGS += -g3
CFLAGS += -g3 -Wno-unused
endif
ifeq ($(DEBUG), 2)
GCC_ARGS += -g3
CFLAGS += -g3 -Werror
endif
all: $(NAME_LIB) $(NAME)
ifeq ($(DEBUG), 0)
@printf "\033[0;32mWARNING : RELEASE MAKE\033[0m\n"
endif
ifeq ($(DEBUG), 1)
@printf "\033[0;33mWARNING : PERMISSIVE DEBUG MAKE\033[0m\n"
endif
ifeq ($(DEBUG), 2)
@printf "\a\033[0;31mWARNING : DEBUG MAKE\033[0m\n"
endif
$(NAME_LIB): $(OBJ_LIB)
$(MAKE) -C ./lib
@printf "\033[0;32m$(NAME_LIB) compilation success\033[0m\n"
$(NAME): $(NAME_LIB) $(PROJECT_OBJ)
$(CC) -o $(NAME) $(PROJECT_OBJ) $(GCC_ARGS) ./lib/$(NAME_LIB) $(CSFML_ARGS)
@printf "\033[0;32m$(NAME) compilation success\033[0m\n"
clean:
$(RM) $(PROJECT_OBJ)
$(MAKE) -C ./lib clean
$(MAKE) -C ./tests clean
$(RM) -f vgcore.*
fclean: clean
$(RM) -f $(NAME)
$(MAKE) -C ./lib fclean
$(MAKE) -C ./tests fclean
@printf "\033[0;32m$(NAME) fully cleaned\033[0m\n"
tests_run:
$(MAKE) -C ./tests tests_run
re: fclean all
.PHONY: all clean fclean re