-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (33 loc) · 817 Bytes
/
Copy pathMakefile
File metadata and controls
45 lines (33 loc) · 817 Bytes
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
SRCS = src/client.c \
src/server.c \
src/utils.c \
PRINTF_SRCS = ft_printf/ft_printf.c \
ft_printf/ft_putchar.c \
ft_printf/ft_puthex.c \
ft_printf/ft_putnbr.c \
ft_printf/ft_putptr.c \
ft_printf/ft_putstr.c \
NAMEC = client
NAMES = server
PRINTF = libftprintf.a
OBJS = $(SRCS:.c=.o)
PRINTF_OBJS = $(PRINTF_SRCS:.c=.o)
LIBC = ar rcs
CC = gcc
RM = rm -f
CFLAGS = -Wall -Wextra -Werror
.c.o:
$(CC) $(CFLAGS) -c $< -o $(<:.c=.o)
all: $(NAMEC) $(NAMES)
$(PRINTF): $(PRINTF_OBJS)
$(LIBC) $(PRINTF) $(PRINTF_OBJS)
$(NAMEC) : src/client.o src/utils.o $(PRINTF)
$(CC) $(CFLAGS) $^ -o $@
$(NAMES) : src/server.o $(PRINTF)
$(CC) $(CFLAGS) $^ -o $@
clean:
$(RM) $(OBJS) $(PRINTF_OBJS)
fclean: clean
$(RM) $(NAMEC) $(NAMES) $(PRINTF)
re: fclean all
.PHONY : all clean fclean re