-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (56 loc) · 2.01 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ael-khni <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/23 15:38:53 by ael-khni #+# #+# #
# Updated: 2021/12/15 19:42:25 by ael-khni ### ########.fr #
# #
# **************************************************************************** #
# Binary Name:
NAME =
CLIENT = client
SERVER = server
#ft_printf Variables:
LIBFTPRINTF = ft_printf/libftprintf.a
LIBFTPRINTF_DIR = ft_printf
#minitalk variables
SRC_C = ft_client.c
SRC_S = ft_server.c
OBJ_S = ft_server.o
OBJ_C = ft_client.o
INC = ft_minitalk.h
#Compiling Variables:
CC = gcc
CFLAG = -Wall -Wextra -Werror
RM = rm -rf
#Colors:
GREEN = \e[38;5;118m
YELLOW = \e[38;5;226m
RESET = \e[0m
_SUCCESS = [$(GREEN)SUCCESS$(RESET)]
_INFO = [$(YELLOW)INFO$(RESET)]
all: $(LIBFTPRINTF) $(CLIENT) $(SERVER)
$(SERVER): $(OBJ_S) $(INC)
@ $(CC) $(CFLAGS) $(LIBFTPRINTF) -o $@ $(OBJ_S)
@printf "$(_SUCCESS) server ready.\n"
$(CLIENT): $(OBJ_C) $(INC)
@ $(CC) $(CFLAGS) $(LIBFTPRINTF) -o $@ $(OBJ_C)
@printf "$(_SUCCESS) client ready.\n"
%.o: %.c
@ $(CC) $(CFLAGS) -c $< -o $@
$(LIBFTPRINTF):
@ $(MAKE) -C $(LIBFTPRINTF_DIR)
clean:
@ $(MAKE) clean -C $(LIBFTPRINTF_DIR)
@ $(RM) $(OBJ_C) $(OBJ_S)
@printf "$(_INFO) object files removed.\n"
fclean: clean
@ $(MAKE) fclean -C $(LIBFTPRINTF_DIR)
@ $(RM) $(CLIENT) $(SERVER)
@printf "$(_INFO) client removed.\n"
@printf "$(_INFO) server removed.\n"
re: fclean all
.PHONY: all clean fclean re