-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (41 loc) · 1.62 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: llawrenc <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/01/02 18:30:10 by llawrenc #+# #+# #
# Updated: 2022/01/03 14:38:46 by llawrenc ### ########.fr #
# #
# **************************************************************************** #
SERVER = server
CLIENT = client
SRC_SERVER = server.c support_functions.c
SRC_CLIENT = client.c support_functions.c
HEADER = minitalk.h
LIB = libft.a
LIB_SRC = -L./Libft -lft
OBJ_SERVER = $(SRC_SERVER:%.c=%.o)
OBJ_CLIENT = $(SRC_CLIENT:%.c=%.o)
CC = gcc
CFLAGS = -Wall -Wextra -Werror
.PHONY : all clean fclean re bonus
all : $(LIB) $(SERVER) $(CLIENT)
bonus : all
$(LIB) :
make -C ./Libft all
$(SERVER) : $(OBJ_SERVER) $(HEADER)
$(CC) $(OBJ_SERVER) $(LIB_SRC) -o $@
$(CLIENT) : $(OBJ_CLIENT) $(HEADER)
$(CC) $(OBJ_CLIENT) $(LIB_SRC) -o $@
%.o : %.c $(HEADER)
$(CC) $(CFLAGS) -c $< -o $@
clean :
make -C ./Libft clean
rm -f $(OBJ_CLIENT) $(OBJ_SERVER)
fclean : clean
make -C ./Libft fclean
rm -f $(SERVER)
rm -f $(CLIENT)
re : fclean all