-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
91 lines (68 loc) · 3.12 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: nvienot <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/12/14 15:52:13 by nvienot #+# #+# #
# Updated: 2019/03/18 23:28:53 by nvienot ### ########.fr #
# #
# **************************************************************************** #
NAME = fractol
SRCS = srcs/main.c srcs/ft_start.c srcs/ft_multithreading.c \
srcs/ft_create.c srcs/ft_utilities.c srcs/ft_calc.c \
srcs/ft_vignettes.c srcs/ft_deal_key.c srcs/ft_deal_mouse.c \
srcs/ft_print.c srcs/ft_color.c srcs/ft_color2.c
CC = gcc
INC. = -I libft/ -I includes/ -I mlx/
INCL = libft/ includes/
FLAGS = -Wall -Werror -Wextra -O2
OBJS = $(SRCS:.c=.o)
F.WORK = -lpthread -lmlx -L mlx -framework OpenGL -framework Appkit
LIB = libft/libft.a
RM = rm -rf
.SILENT :
.PHONY : all clean fclean re
#Colors
_BLACK=\x1b[30m
_RED=\x1b[31m
_GREEN=\x1b[32m
_YELLOW=\x1b[33m
_BLUE=\x1b[34m
_PURPLE=\x1b[35m
_CYAN=\x1b[36m
_WHITE=\x1b[37m
_END=\x1b[0m
all : $(NAME)
$(NAME) : $(OBJS) Makefile includes/fractol.h
make -C libft/
echo "$(_RED)Compiling libft... $(_GREEN)Done$(_END)"
make -C mlx/
echo "$(_RED)Compiling mlx... $(_GREEN)Done$(_END)"
$(CC) -o $(NAME) $(OBJS) $(LIB) $(F.WORK)
echo "$(_RED) _____ _ _ _ _ _ _ "
echo "$(_RED)| ___| | | ( ) | | (_) | | | | "
echo "$(_BLUE)| |_ _ __ __ _ ___| |_ |/ ___ | | _ ___ _ __ ___ __ _ __| |_ _ | | "
echo "$(_PURPLE)| _| '__/ _ |/ __| __| / _ \| | | / __| | '__/ _ \/ _ |/ _ | | | | | | "
echo "$(_CYAN)| | | | | (_| | (__| |_ | (_) | | | \__ \ | | | __/ (_| | (_| | |_| | |_| "
echo "$(_GREEN)\_| |_| \__,_|\___|\__| \___/|_| |_|___/ |_| \___|\__,_|\__,_|\__, | (_) "
echo "$(_YELLOW) __/ | "
echo "$(_WHITE)By $(_RED)nvienot $(_GREEN)2019 $(_YELLOW)!$(_WHITE)!$(_END) |___/ \n"
$(OBJS) : %.o: %.c
$(CC) $(FLAGS) $(INC.) -c $< -o $@
clean :
make clean -C libft/
make clean -C mlx/
$(RM) $(OBJS)
echo "$(_RED)Cleaning obj... $(_GREEN)Done$(_END)"
fclean : clean
$(RM) $(NAME)
make fclean -C libft/
echo "$(_RED)Cleaning all... $(_GREEN)Done$(_END)"
re : fclean all
recl : re
make clean
norm : fclean
echo "$(_RED)Starting norminette...$(_END)"
norminette $(SRCS) $(INCL) | grep -B 1 '^Error' 2> /dev/null && echo "$(_RED)Norm KO :(" || echo "$(_GREEN)Norm OK ! :)$(_END)";