-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (50 loc) · 1.86 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
69
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: kael-ala <kael-ala@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/03/03 18:15:35 by kael-ala #+# #+# #
# Updated: 2024/03/03 18:17:09 by kael-ala ### ########.fr #
# #
# **************************************************************************** #
CNAME = client
SNAME = server
CBNAME = client_bonus
SBNAME = server_bonus
CC = cc
CFLAGS = -Wall -Wextra -Werror
RM = rm -f
FILES = ./ft_printf/ft_printf.c ./ft_printf/printtools.c ./ft_printf/printtoolss.c ./ft_printf/ft_atoi.c
CFILES = client.c
SFILES = server.c
CBFILES = client_bonus.c
SBFILES = server_bonus.c
OBJ = $(FILES:.c=.o)
COBJ = $(CFILES:.c=.o)
SOBJ = $(SFILES:.c=.o)
CBOBJ = $(CBFILES:.c=.o)
SBOBJ = $(SBFILES:.c=.o)
all : $(CNAME) $(SNAME)
$(CNAME) : $(OBJ) $(COBJ)
$(CC) $^ -o $@
$(SNAME) : $(OBJ) $(SOBJ)
$(CC) $^ -o $@
bonus : $(CBNAME) $(SBNAME)
$(CBNAME) : $(OBJ) $(CBOBJ)
$(CC) $^ -o $@
$(SBNAME) : $(OBJ) $(SBOBJ)
$(CC) $^ -o $@
${CBOBJ} : ./include/minitalk_bonus.h
${SBOBJ} : ./include/minitalk_bonus.h
${OBJ} : ./include/ft_printf.h
${COBJ} : ./include/minitalk.h
${SOBJ} :./include/minitalk.h
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(OBJ) $(COBJ) $(SOBJ) $(CBOBJ) $(SBOBJ)
fclean: clean
$(RM) $(SNAME) $(CNAME) $(SBNAME) $(CBNAME)
re: fclean all