-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
140 lines (119 loc) · 3.52 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jnovotny <jnovotny@student.hive.fi> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/12/12 16:50:37 by jnovotny #+# #+# #
# Updated: 2020/01/21 14:42:47 by jnovotny ### ########.fr #
# #
# **************************************************************************** #
C_RED = \033[1;31m
C_GREEN = \033[1;32m
C_L_GREEN = \033[1;32m
C_BLUE = \033[1;34m
C_L_BLUE = \033[1;34m
C_WHITE = \033[1;37m
C_RES = \033[0m
NAME = push_swap
CHECK = checker
LIB = ./libft/libft.a
FTS = check_sort.c \
clear_list.c \
cmd_man.c \
cmd_man2.c \
cmd_parse.c \
cmd_parse2.c \
cmd_parse3.c \
cmp_control.c \
exit.c \
ft_getflags_arg.c \
list_man.c \
list_man2.c \
list_man3.c \
list_man4.c \
list_print.c \
ps_init.c \
ps_iterquicksort.c \
ps_operations.c \
ps_operations2.c \
ps_operations3.c \
ps_qs_tools.c \
ps_qs_tools2.c \
ps_sortop3.c \
ps_tools.c \
push_swap_ops.c \
push_swap_iterquicksort.c \
read_numbers.c \
vfx_colors.c \
vfx_draw_env.c \
vfx_draw_graph.c \
vfx_draw_graph2.c \
vfx_draw_playback.c \
vfx_draw_text.c \
vfx_engine.c \
vfx_environment.c \
visualize.c
L_FTS = check_sort.c \
clear_list.c \
cmd_man.c \
cmd_man2.c \
cmd_parse.c \
cmd_parse2.c \
cmd_parse3.c \
cmp_control.c \
exit.c \
ft_getflags_arg.c \
list_man.c \
list_man2.c \
list_man3.c \
list_man4.c \
list_print.c \
ps_init.c \
ps_iterquicksort.c \
ps_operations.c \
ps_operations2.c \
ps_operations3.c \
ps_qs_tools.c \
ps_qs_tools2.c \
ps_sortop3.c \
ps_tools.c \
push_swap_ops.c \
push_swap_iterquicksort_novis.c \
read_numbers.c
FTO = $(FTS.c=.o)
LIB_I = ./libft/includes/
I_DIR = ./includes/
S_DIR = ./srcs/
O_DIR = ./objs/
SRCS = $(addprefix $(S_DIR), $(FTS))
L_SRCS = $(addprefix $(S_DIR), $(L_FTS))
PS_M = ./srcs/main_pushswap.c
CH_M = ./srcs/main_checker.c
CNV_M = ./srcs/main_checker_novis.c
CFLAGS = -Wall -Werror -Wextra
GRAPHIC = -I /usr/local/include -L /usr/local/lib/ -lmlx -framework OpenGL -framework AppKit
.PHONY: all clean fclean re libft
all: $(NAME) $(CHECK)
libft:
@make -C ./libft
$(NAME): libft
@gcc -o $(NAME) $(CFLAGS) -I$(I_DIR) -I$(LIB_I) $(LIB) $(SRCS) $(PS_M) $(GRAPHIC)
@echo "$(C_GREEN)[$(C_BLUE)$(NAME)$(C_GREEN) was compiled]$(C_RES)"
$(CHECK): libft
@gcc -o $(CHECK) $(CFLAGS) -I$(I_DIR) -I$(LIB_I) $(LIB) $(SRCS) $(CH_M) $(GRAPHIC)
@echo "$(C_GREEN)[$(C_BLUE)$(CHECK)$(C_GREEN) was compiled]$(C_RES)"
nograph: libft
@gcc -o $(NAME) $(CFLAGS) -I$(I_DIR) -I$(LIB_I) $(L_SRCS) $(PS_M) $(LIB)
@gcc -o $(CHECK) $(CFLAGS) -I$(I_DIR) -I$(LIB_I) $(L_SRCS) $(CNV_M) $(LIB)
@echo "$(C_GREEN)[Non-graphic versions of $(C_BLUE)$(NAME)$(C_GREEN) and $(C_BLUE)$(CHECK)$(C_GREEN) were compiled]$(C_RES)"
clean:
@make clean -C ./libft
@/bin/rm -rf $(O_DIR)
@echo "$(C_RED)[Objects deleted!]$(C_RES)"
fclean: clean
@make fclean -C ./libft
@/bin/rm -f $(NAME) $(CHECK) ps_linux
@echo "$(C_RED)[Removed $(NAME) and $(CHECK)]$(C_RES)"
re: fclean all