-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (35 loc) · 808 Bytes
/
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
CC = gcc
FLAGS = -Wall -Wextra -Werror
RM = rm -f
NAME_C = client
NAME_S = server
SRCS_C = client.c
SRCS_S = server.c
SRCS_C_B = client_bonus.c
SRCS_S_B = server_bonus.c
LIBFT = ./libft/libft.a
OBJS_C = $(SRCS_C:.c=.o)
OBJS_S = $(SRCS_S:.c=.o)
OBJS_C_B = $(SRCS_C:.c=.o)
OBJS_S_B = $(SRCS_S:.c=.o)
all: $(NAME_C) $(NAME_S)
$(NAME_C) :
$(MAKE) bonus -C libft
gcc $(SRCS_C) $(FLAGS) $(LIBFT) -o $(NAME_C)
$(NAME_S) :
gcc $(SRCS_S) $(FLAGS) $(LIBFT) -o $(NAME_S)
bonus :
$(MAKE) bonus -C libft
gcc $(SRCS_C_B) $(FLAGS) $(LIBFT) -o $(NAME_C)
gcc $(SRCS_S_B) $(FLAGS) $(LIBFT) -o $(NAME_S)
clean:
$(MAKE) clean -C libft
$(RM) $(OBJS_C)
$(RM) $(OBJS_S)
$(RM) $(OBJS_C_B)
$(RM) $(OBJS_S_B)
fclean: clean
$(RM) $(NAME_C)
$(RM) $(NAME_S)
re: fclean all
.PHONY: all clean fclean re