-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (31 loc) · 704 Bytes
/
Makefile
File metadata and controls
42 lines (31 loc) · 704 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
NAME = philo
CC = cc
CFLAGS = -Wextra -Wall -Werror
OBJ_DIR = obj/
SRC_DIR = src/
HEADERS = -I ./inc
PHILOH = ./inc/philo.h
SRC = main.c \
cleanup.c \
init.c \
parsing.c \
print_error.c \
routine_observer.c \
routine_philo_actions.c \
routine_philo.c \
routine_utils.c \
thread_mutex_handles.c \
utils_libft.c
OBJS = $(addprefix $(OBJ_DIR), $(SRC:.c=.o))
all: $(NAME)
$(OBJ_DIR)%.o: $(SRC_DIR)%.c $(PHILOH)
@mkdir -p $(dir $@)
$(CC) $(CFLAGS) -o $@ -c $< $(HEADERS)
$(NAME): $(OBJS) $(PHILOH)
$(CC) $(OBJS) $(LIBFT) $(HEADERS) -o $(NAME)
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all, clean, fclean, re