-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (40 loc) · 1.59 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rlucio-l <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/01/21 13:12:56 by rlucio-l #+# #+# #
# Updated: 2022/02/14 21:48:23 by rlucio-l ### ########.fr #
# #
# **************************************************************************** #
NAME = minitalk
LIBFT_DIR = ./libft
LIBFT = $(LIBFT_DIR)/libft.a
CLIENT = client
SERVER = server
CLIENT_SRC = client.c
SERVER_SRC = server.c
CLIENT_OBJ = $(CLIENT_SRC:.c=.o)
SERVER_OBJ = $(SERVER_SRC:.c=.o)
CC = gcc
CFLAGS += -Wall -Wextra -Werror -I ./include
.c.o :
$(CC) ${CFLAGS} -c $< -o ${<:.c=.o}
$(NAME): all
all: $(LIBFT) $(CLIENT) $(SERVER)
$(LIBFT):
make -C $(LIBFT_DIR)
$(CLIENT): $(CLIENT_OBJ)
$(CC) -o $(CLIENT) $(CLIENT_OBJ) $(LIBFT)
$(SERVER): $(SERVER_OBJ)
$(CC) -o $(SERVER) $(SERVER_OBJ) $(LIBFT)
clean:
make -C $(LIBFT_DIR) clean
rm -f $(CLIENT_OBJ) $(SERVER_OBJ)
fclean: clean
make -C $(LIBFT_DIR) fclean
rm -f $(CLIENT) $(SERVER)
re: fclean all
.PHONY: all clean fclean re libft