-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (39 loc) · 1.57 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
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: cavan-vl <[email protected]> +#+ #
# +#+ #
# Created: 2024/04/18 20:42:56 by cavan-vl #+# #+# #
# Updated: 2024/05/15 16:11:24 by cavan-vl ######## odam.nl #
# #
# **************************************************************************** #
SOURCES = server.c client.c
OBJ = $(SOURCES:.c=.o)
CC = gcc
CFLAGS = -Wall -Werror -Wextra -no-pie -g
# CFLAGS += -fsanitize=address -g
OBJ_DIR := obj/
OBJS := $(addprefix $(OBJ_DIR), $(SRC_FILES:.c=.o))
all: libft server client
all:
@make -s --no-print-directory -C libft >/dev/null
@make server client >/dev/null
server: server.o
@ echo "Server is ready!"
@ $(CC) $(CFLAGS) -o $@ $< libft/libft.a
client: client.o
@ echo "Client is ready!"
@ $(CC) $(CFLAGS) -o $@ $< libft/libft.a
%.o: %.c
@ $(CC) -c $(CFLAGS) -o $@ $<
libft:
@ make -C libft
clean:
@ rm -f $(OBJ)
@ make -C libft clean
fclean: clean
@ rm -f server client libft/libft.a
re: fclean all
.PHONY: all libft clean fclean re