-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
56 lines (37 loc) · 1.66 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: mbesan <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/09 00:51:43 by mbesan #+# #+# #
# Updated: 2021/11/09 17:50:24 by mbesan ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CFLAGS = -Wall -Wextra -Werror
SOURCES = libft/ft_putnbr_fd.c libft/ft_strlen.c\
libft/ft_putchar_fd.c libft/ft_atoi.c
OBJECTS = $(SOURCES:.c=.o)
SERVER_SRC = ft_server.c
SERVER_B = server
CLIENT_SRC = ft_client.c
CLIENT_B = client
BONUS_OBJS = ft_server_bonus.o ft_client_bonus.o
all: $(SERVER_B) $(CLIENT_B)
$(SERVER_B): $(SERVER_SRC:.c=.o) $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
$(CLIENT_B): $(CLIENT_SRC:.c=.o) $(OBJECTS)
$(CC) $(CFLAGS) -o $@ $^
bonus:
@make SERVER_SRC="ft_server_bonus.c" CLIENT_SRC="ft_client_bonus.c" all
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
make clean -C ./libft
rm -rf $(OBJS) $(SERVER_SRC:.c=.o) $(CLIENT_SRC:.c=.o) $(BONUS_OBJS)
fclean: clean
rm -f $(SERVER_B) $(CLIENT_B) libft/libft.a
re: fclean all
.PHONY: all clean fclean re