-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
99 lines (76 loc) · 2.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
CC = gcc
RM = rm -f
LIB = cd libmy/; make
LIB_CLEAN = cd libmy/; make clean
LIB_FCLEAN = cd libmy/; make fclean
CFLAGS = -Wall -Werror -W -Wextra
NAME_CLIENT = client_bin
NAME_SERVER = server_bin
SRCS_CLIENT = client/bzero.c \
client/connect.c \
client/freetab.c \
client/get_cmd.c \
client/main.c \
client/my_client.c \
client/tablen.c \
client/my_string.c \
SRCS_SERVER = server/functions/main.c \
server/functions/add_client.c \
server/functions/add_elem.c \
server/functions/change_chan.c \
server/functions/check_user_in_chan.c \
server/functions/freetab.c \
server/functions/client_read.c \
server/functions/create_env.c \
server/functions/create_node.c \
server/functions/get_cmd.c \
server/functions/get_current.c \
server/functions/get_cmd_serv.c \
server/functions/list.c \
server/functions/move_node.c \
server/functions/my_disconnect.c \
server/functions/my_join.c \
server/functions/my_putnbr_fd.c \
server/functions/my_putstr_fd.c \
server/functions/my_server.c \
server/functions/send_msg_in_chan.c \
server/functions/show_all_users.c \
server/functions/tablen.c \
server/functions/free_struct.c \
server/functions/free_chain.c \
server/functions/my_whisp.c \
server/functions/my_nick.c \
server/functions/cmd_exit_func.c \
server/functions/cmd_list.c
OBJS_CLIENT = $(SRCS_CLIENT:%.c=%.o)
OBJS_SERVER = $(SRCS_SERVER:%.c=%.o)
client: $(NAME_CLIENT)
server: $(NAME_SERVER)
$(NAME_CLIENT): $(OBJS_CLIENT)
@$(LIB)
@echo "-> Compilation client_bin ..."
$(CC) $(OBJS_CLIENT) -L libmy/ -lmy $(CFLAGS) -o $(NAME_CLIENT) $(LDFLAGS)
$(NAME_SERVER): $(OBJS_SERVER)
@$(LIB)
@echo "-> Compilation server_bin ..."
$(CC) $(OBJS_SERVER) -L libmy/ -lmy $(CFLAGS) -o $(NAME_SERVER) $(LDFLAGS)
clean_client:
@echo "-> clean client..."
@$(RM) $(OBJS_CLIENT)
@$(LIB_CLEAN)
fclean_client: clean_client
@echo "-> fclean client..."
@$(RM) $(NAME_CLIENT)
@$(LIB_FCLEAN)
clean_server:
@echo "-> clean server..."
@$(RM) $(OBJS_SERVER)
@$(LIB_CLEAN)
fclean_server: clean_server
@echo "-> fclean server..."
@$(RM) $(NAME_SERVER)
@$(LIB_FCLEAN)
re: fclean clean
re_client: fclean_client client clean_client
re_server: fclean_server server clean_server
.PHONY: clean fclean re clean_client clean_server fclean_client fclean_server re_client re_server