-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
73 lines (55 loc) · 1.78 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
# Server
SERVER = server
SERVER_SRC = ./server.c
SERVER_BONUS = server_bonus
SERVER_BONUS_SRC = ./server_bonus.c
# Client
CLIENT = client
CLIENT_SRC = ./client.c
CLIENT_BONUS = client_bonus
CLIENT_BONUS_SRC = ./client_bonus.c
# Libft
LIBFT = libft.a
LIBFT_SRC = ./libft/
# Compiler
CC = gcc
RM = rm -f
CFLAGS = -Wall -Werror -Wextra
# Colours
BLACK = \033[0;30m
RED = \033[0;31m
GREEN = \033[0;32m
YELLOW = \033[0;33m
BLUE = \033[0;34m
PURPLE = \033[0;35m
CYAN = \033[0;36m
WHITE = \033[0;37m
RESET = \033[0m
# Rules
all: $(LIBFT) $(SERVER) $(CLIENT)
@printf "$(BLUE)==> $(CYAN)Minitalk compiled ✅\n$(RESET)"
bonus: $(LIBFT) $(SERVER_BONUS) $(CLIENT_BONUS)
@printf "$(BLUE)==> $(CYAN)Minitalk bonus compiled ✅✨\n$(RESET)"
$(LIBFT):
@make -C libft bonus
$(SERVER): $(SERVER_SRC)
$(CC) $(CFLAGS) $(SERVER_SRC) $(LIBFT_SRC)$(LIBFT) -o $(SERVER)
@printf "$(GREEN)Server compiled ✅\n\n$(RESET)"
$(SERVER_BONUS): $(SERVER_BONUS_SRC)
$(CC) $(CFLAGS) $(SERVER_BONUS_SRC) $(LIBFT_SRC)$(LIBFT) -o $(SERVER_BONUS)
@printf "$(GREEN)Server bonus compiled ✅✨\n\n$(RESET)"
$(CLIENT): $(CLIENT_SRC)
$(CC) $(CFLAGS) $(CLIENT_SRC) $(LIBFT_SRC)$(LIBFT) -o $(CLIENT)
@printf "$(GREEN)Client compiled ✅\n\n$(RESET)"
$(CLIENT_BONUS): $(CLIENT_BONUS_SRC)
$(CC) $(CFLAGS) $(CLIENT_BONUS_SRC) $(LIBFT_SRC)$(LIBFT) -o $(CLIENT_BONUS)
@printf "$(GREEN)Client bonus compiled ✅✨\n\n$(RESET)"
$(CLIENT_BONUS):
clean:
@$(RM) $(CLIENT) $(SERVER) $(SERVER_BONUS) $(CLIENT_BONUS)
@printf "\n$(BLUE)==> $(RED)Removed minitalk 🗑️\n$(RESET)"
fclean: clean
@make -C libft fclean
re: fclean all
@printf "$(BLUE)==> $(CYAN)Minitalk recompiled 🔄\n$(RESET)"
.PHONY: all clean fclean re bonus