-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (27 loc) · 733 Bytes
/
Makefile
File metadata and controls
36 lines (27 loc) · 733 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
COMPILER = clang
CFLAGS = -Wall -Wextra -Werror -O2 -DALIGN_8=__attribute__\(\(aligned\(8\)\)\)
LFLAGS = -Wall -Wextra -Werror -O2
NAME = philo
SRC_DIR = sources
SOURCES = $(SRC_DIR)/atomic_primitives.c \
$(SRC_DIR)/event_queue.c \
$(SRC_DIR)/fork.c \
$(SRC_DIR)/helpers.c \
$(SRC_DIR)/initialize_context.c \
$(SRC_DIR)/main.c \
$(SRC_DIR)/philo.c \
$(SRC_DIR)/philo_life.c \
OBJS = $(patsubst %, %.o, $(SOURCES))
DEPS = $(patsubst %, %.d, $(SOURCES))
LIBS = -lpthread
all : $(NAME)
$(NAME): $(OBJS)
$(COMPILER) $(LFLAGS) -o $(NAME) $(OBJS) $(LIBS)
%.c.o: %.c
$(COMPILER) $(CFLAGS) -o $@ -c $< -MMD
clean:
rm -rf $(OBJS) $(DEPS)
fclean: clean
rm -rf $(NAME)
re: fclean all
-include $(DEPS)