-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·61 lines (44 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: raveriss <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/10/02 04:47:01 by raveriss #+# #+# #
# Updated: 2023/10/05 15:59:12 by raveriss ### ########.fr #
# #
# **************************************************************************** #
NAME = philo
SRC_DIR = src
OBJ_DIR = objs
INC_DIR = inc
SRCS = check_death.c \
clean.c \
ft_atol.c \
init.c \
life.c \
philo_utils.c \
philo.c \
SRCS := $(SRCS:%=$(SRC_DIR)/%)
OBJS := $(SRCS:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
DEPS := $(OBJS:.o=.d)
CC = gcc
C_FLAGS = -Wall -Wextra -Werror -MMD
DIR_DUP = mkdir -p $(@D)
all : $(NAME)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(DIR_DUP)
$(CC) $(C_FLAGS) -I $(INC_DIR) -c $< -o $@
$(NAME) : $(OBJS) Makefile
$(CC) $(C_FLAGS) $(OBJS) -o $@
-include $(DEPS)
clean :
rm -f $(OBJS)
rm -f $(DEPS)
rm -rf $(OBJ_DIR)
fclean : clean
rm -f $(NAME)
re : fclean
make all
.PHONY : all clean fclean re