-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
45 lines (33 loc) · 1.51 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rtavabil <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/02/16 13:48:44 by rtavabil #+# #+# #
# Updated: 2024/03/21 18:48:36 by rtavabil ### ########.fr #
# #
# **************************************************************************** #
NAME := philo
SRC := philosophers.c arguments.c functions.c strings.c \
initialization.c algorithm.c utils.c free.c \
algo_utils.c philo_jobs.c
OBJ := $(SRC:.c=.o)
CC := cc
CFLAGS := -Wall -Wextra -Werror #-g3 -gdwarf-3 #-fsanitize=thread
OBJ_PATH := obj/
OBJS := $(addprefix $(OBJ_PATH), $(OBJ))
all: $(NAME)
$(OBJ_PATH)%.o: %.c
@mkdir -p $(OBJ_PATH)
@$(CC) $(CFLAGS) -c $< -o $@
$(NAME): $(OBJS)
@$(CC) $(CFLAGS) -pthread -o $(NAME) $(OBJS)
clean:
@rm -rf $(OBJ_PATH)
fclean: clean
@rm -f $(NAME)
re: fclean all
.PHONY: all re clean fclean
#philosophers.c arguments.c functions.c strings.c initialization.c algorithm.c utils.c