-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (41 loc) · 1.72 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: letumany <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/12/02 19:11:25 by letumany #+# #+# #
# Updated: 2022/02/19 12:43:22 by letumany ### ########.fr #
# #
# **************************************************************************** #
CC = gcc
CC_FLAGS = -Wall -Wextra -Werror
RM = rm -rf
DIR_HEADERS = ./includes/
DIR_SRCS = ./srcs/
DIR_OBJS = ./compiled_srcs/
SRC = philo.c init.c time.c\
izanami.c utils.c
SRCS = $(SRC)
OBJS = $(SRCS:%.c=$(DIR_OBJS)%.o)
NAME = philo
all: $(NAME)
$(NAME): $(OBJS)
@tput setaf 2 && printf "\033[2K\r.o compiled.\n"
@$(CC) $(CC_FLAGS) -I $(DIR_HEADERS) $(OBJS) -o $(NAME)
@tput setaf 2 && printf "$(NAME) created.\n"
$(OBJS): $(DIR_OBJS)
$(DIR_OBJS)%.o: $(DIR_SRCS)%.c
@tput setaf 190 && printf "\033[2K\r Compiling $<"
@$(CC) $(CC_FLAGS) -I $(DIR_HEADERS) -c $< -o $@
$(DIR_OBJS):
@mkdir $@
clean:
@$(RM) $(DIR_OBJS)
@tput setaf 928 && printf ".o deleted.\n"
fclean: clean
@$(RM) $(NAME)
@tput setaf 928 && printf ""$(NAME)" deleted.\n"
re: fclean all
.PHONY: all clean fclean re norm