-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
59 lines (42 loc) · 1.23 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
##
## EPITECH PROJECT, 2018
## cpp_babel_2018
## File description:
## Makefile
##
NAME = babel
SERVER = babel_server
CLIENT = babel_client
BUILD_DIR_DBG = cmake-build-debug
BUILD_DIR_REL = build
CMAKE = cmake
MKDIR = mkdir
CONAN = conan
RM = rm -rf
GENERATOR = "Unix Makefiles"
all: $(SERVER) $(CLIENT)
server: $(SERVER)
client: $(CLIENT)
cmake-gen:
$(MKDIR) $(BUILD_DIR)
cd $(BUILD_DIR) && \
$(CONAN) install .. --build=missing && \
$(CMAKE) -G $(GENERATOR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) $(SRC_DIR)
$(BUILD_DIR_DBG):
$(MAKE) -C . SRC_DIR=$(abspath .) BUILD_DIR=$@ BUILD_TYPE=Debug cmake-gen
$(BUILD_DIR_REL):
$(MAKE) -C . SRC_DIR=$(abspath .) BUILD_DIR=$@ BUILD_TYPE=Release cmake-gen
$(NAME): | $(BUILD_DIR_REL)
$(CMAKE) --build $(BUILD_DIR_REL) --target babel
$(CLIENT): | $(BUILD_DIR_REL)
$(CMAKE) --build $(BUILD_DIR_REL) --target babel_client
$(SERVER): | $(BUILD_DIR_REL)
$(CMAKE) --build $(BUILD_DIR_REL) --target babel_server
install: | $(BUILD_DIR_REL)
$(CMAKE) --build $(BUILD_DIR_REL) --target install
clean: | $(BUILD_DIR_DBG)
$(CMAKE) --build $(BUILD_DIR_REL) --target clean
fclean:
$(RM) $(BUILD_DIR_DBG) $(BUILD_DIR_REL) $(SERVER) $(CLIENT)
re: fclean all
.PHONY: all cmake-gen $(NAME) clean fclean re