-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (64 loc) · 2.84 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: abazerou <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/26 23:12:37 by abazerou #+# #+# #
# Updated: 2023/03/05 17:08:39 by abazerou ### ########.fr #
# #
# **************************************************************************** #
CLIENT = client
SERVER = server
CLIENT_B = client_bonus
SERVER_B = server_bonus
PRINTF = ft_printf/libftprintf.a
PRINTF_DIR = ft_printf/
HEADER = minitalk.h
SRC_C = client.c
SRC_S = server.c
SRCB_C = client_bonus.c
SRCB_S = server_bonus.c
CFLAG = -Wall -Wextra -Werror
RM = rm -f
red = `tput setaf 1`
green = `tput setaf 2`
white = `tput setaf 7`
all: $(SERVER) $(CLIENT) $(SERVER_B) $(CLIENT_B)
$(SERVER): $(PRINTF) $(HEADER) $(SRC_S)
@ $(CC) $(CFLAG) $(SRC_S) $(PRINTF) -o $(SERVER)
@echo " [$(green)SUCCESS$(white)] server $(green)ready$(white)."
$(CLIENT): $(PRINTF) $(HEADER) $(SRC_C)
@ $(CC) $(CFLAG) $(SRC_C) $(PRINTF) -o $(CLIENT)
@echo " [$(green)SUCCESS$(white)] client $(green)ready$(white)."
$(SERVER_B): $(PRINTF) $(HEADER) $(SRCB_S)
@ $(CC) $(CFLAG) $(SRCB_S) $(PRINTF) -o $(SERVER_B)
@echo " [$(green)SUCCESS$(white)] server_bonus $(green)ready$(white)."
$(CLIENT_B): $(PRINTF) $(HEADER) $(SRCB_C)
@ $(CC) $(CFLAG) $(SRCB_C) $(PRINTF) -o $(CLIENT_B)
@echo " [$(green)SUCCESS$(white)] client_bonus $(green)ready$(white)."
$(PRINTF):
@ $(MAKE) -C $(PRINTF_DIR)
clean:
@ $(RM) $(CLIENT) $(SERVER)
@echo " [$(red)INFO$(white)] client $(red)removed$(white)."
@echo " [$(red)INFO$(white)] server $(red)removed$(white)."
@ $(RM) $(CLIENT_B) $(SERVER_B)
@echo " [$(red)INFO$(white)] client_bonus $(red)removed$(white)."
@echo " [$(red)INFO$(white)] server_bonus $(red)removed$(white)."
fclean:
@ $(MAKE) fclean -C $(PRINTF_DIR)
@echo " [$(red)INFO$(white)] object files $(red)removed$(white)."
@ $(RM) $(CLIENT) $(SERVER)
@echo " [$(red)INFO$(white)] client $(red)removed$(white)."
@echo " [$(red)INFO$(white)] server $(red)removed$(white)."
@ $(RM) $(CLIENT_B) $(SERVER_B)
@echo " [$(red)INFO$(white)] client_bonus $(red)removed$(white)."
@echo " [$(red)INFO$(white)] server_bonus $(red)removed$(white)."
re: fclean all
mandatory: $(CLIENT) $(SERVER)
bonus: $(CLIENT_B) $(SERVER_B)
m : mandatory
b : bonus
.PHONY: all clean fclean re mandatory m bonus b