-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (45 loc) · 1.96 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aizsak <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/10 12:41:39 by aizsak #+# #+# #
# Updated: 2022/12/22 15:34:46 by aizsak ### ########.fr #
# #
# **************************************************************************** #
CLIENT = client
SERVER = server
SRC_CLIENT = src/client.c
SRC_SERVER = src/server.c
BONUS_CLIENT = bonus/client_bonus.c
BONUS_SERVER = bonus/server_bonus.c
CC = gcc
OBJ_SERVER = $(SRC_SERVER:.c=.o)
OBJ_CLIENT = $(SRC_CLIENT:.c=.o)
OBJ_CLIENT_BONUS = $(BONUS_CLIENT:.c=.o)
OBJ_SERVER_BONUS = $(BONUS_SERVER:.c=.o)
LIB_PATH = libft/
LIB = -Llibft -lft
INCLUDES = ./includes
CFLAGS = -Werror -Wextra -Wall -I$(INCLUDES)
all : $(CLIENT) $(SERVER)
$(SERVER) : $(OBJ_SERVER)
$(MAKE) -C $(LIB_PATH)
$(CC) $(CFLAGS) $(OBJ_SERVER) $(LIB) -o $(SERVER)
$(CLIENT) : $(OBJ_CLIENT)
$(MAKE) -C $(LIB_PATH)
$(CC) $(CFLAGS) $(OBJ_CLIENT) $(LIB) -o $(CLIENT)
bonus : $(OBJ_CLIENT_BONUS) $(OBJ_SERVER_BONUS)
$(MAKE) -C $(LIB_PATH)
$(CC) $(CFLAGS) $(OBJ_CLIENT_BONUS) $(LIB) -o $(CLIENT)
$(CC) $(CFLAGS) $(OBJ_SERVER_BONUS) $(LIB) -o $(SERVER)
clean :
$(MAKE) clean -C $(LIB_PATH)
rm -f $(OBJ_CLIENT) $(OBJ_SERVER) $(OBJ_CLIENT_BONUS) $(OBJ_SERVER_BONUS)
fclean : clean
$(MAKE) fclean -C $(LIB_PATH)
rm -f $(CLIENT) $(SERVER)
re : fclean $(CLIENT) $(SERVER)
PHONY: all clean fclean re