-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (27 loc) · 946 Bytes
/
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
_GREEN = \x1b[32m
NAME = philo
NAME_B = philo_bonus/philo_bonus
SRCS = philo.c ft_parsing.c ft_atoi.c ft_init.c ft_routine.c utils.c
SRCS_B = philo_bonus/philo_bonus.c philo_bonus/ft_parsing_bonus.c philo_bonus/ft_atoi_bonus.c \
philo_bonus/ft_init_bonus.c philo_bonus/ft_strcpy_bonus.c \
philo_bonus/ft_routine_bonus.c philo_bonus/utils_bonus.c
HEADER = philo.h
OBJS = ${SRCS:.c=.o}
HEADER_B = philo_bonus/philo_bonus.h
OBJS_B = ${SRCS_B:.c=.o}
CC = gcc
FLAGS = -Wall -Werror -Wextra -pthread
RM = rm -f
.PHONY : all clean fclean re bonus
all : ${NAME}
${NAME} : ${OBJS} ${HEADER}
${CC} ${FLAGS} ${OBJS} -o ${NAME}
@echo "$(_GREEN) Executable '$(NAME)' created! $(_END)✅"
bonus :
make OBJS="${OBJS_B}" HEADER="${HEADER_B}" NAME="${NAME_B}" all
clean :
${RM} ${OBJS} ${OBJS_B}
fclean : clean
${RM} ${NAME} ${NAME_B}
@echo "$(_GREEN) Executable file has been deleted! $(_END)🗑️"
re : fclean all