-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
113 lines (94 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: yrhiba <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/01/08 14:20:39 by yrhiba #+# #+# #
# Updated: 2023/01/24 02:19:37 by yrhiba ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
BONUS_NAME = checker
COMPILER = cc
OBJFLAGS = -Wall -Wextra -Werror
PSRC = push_swap.c
BSRC = checker.c
OBJPSRC = $(addprefix $(ODIR), $(PSRC:.c=.o))
OBJBSRC = $(addprefix $(ODIR), $(BSRC:.c=.o))
SRCS = algorithms/longest_incresing_sub.c \
parse/check_argv.c \
parse/staks_init.c \
data_utils/data_dup.c \
data_utils/data_lis_init.c \
data_utils/data_in_sub_init.c \
set_funcs/set_tar_pos.c \
set_funcs/set_prev_data.c \
set_funcs/set_lis.c \
set_funcs/set_in_sub.c \
set_funcs/set_cur_pos.c \
get_funcs/get_max_lsi.c \
get_funcs/get_min_cost_pb_in_sub.c \
get_funcs/get_max_data.c \
get_funcs/get_min_data.c \
get_funcs/get_to_data.c \
get_funcs/get_min_cost_pa.c \
calc_funcs/calc_cost_pa.c \
calc_funcs/calc_cost_pb.c \
calc_funcs/calc_cost_tp.c \
calc_funcs/calc_size_not_in_sub.c \
operations_utils/swap.c \
operations_utils/push.c \
operations_utils/rotate.c \
operations_utils/reverse_rotate.c \
operations/sa.c \
operations/sb.c \
operations/ss.c \
operations/pa.c \
operations/pb.c \
operations/ra.c \
operations/rb.c \
operations/rr.c \
operations/rra.c \
operations/rrb.c \
operations/rrr.c \
sort_floors/init_floor.c \
sort_floors/floor_one.c \
sort_floors/floor_two.c \
sort_floors/end_floor.c \
sort_floors/floor_two_utils.c \
utils/is_sorted.c \
utils/min_int.c \
utils/max_int.c \
utils/word_count.c \
utils/av_isvalid.c \
debug/print_ab.c \
debug/print_lsi.c \
debug/print_statu.c \
clear/ps_clear.c \
clear/av_clear.c
INCS = libft/libft.h libmylist/my_list.h
ODIR = objs/
OBJS = $(addprefix $(ODIR), $(SRCS:.c=.o))
$(NAME) : $(OBJS) $(OBJPSRC)
make all -C libft
make all -C libmylist
$(COMPILER) $(OBJS) $(OBJPSRC) -L libft -l ft -L libmylist -l mylist -o $(NAME)
all : $(NAME)
$(ODIR)%.o : %.c $(INCS)
@mkdir -p $(dir $@)
$(COMPILER) $(OBJFLAGS) -I . -I libft -I libmylist -c $< -o $@
clean :
make fclean -C libft
make fclean -C libmylist
rm -rf $(ODIR)
fclean : clean
rm -rf $(NAME) $(BONUS_NAME)
re : fclean all
$(BONUS_NAME) : $(OBJS) $(OBJBSRC)
make all -C libft
make all -C libmylist
$(COMPILER) $(OBJS) $(OBJBSRC) -L libft -l ft -L libmylist -l mylist -o $(BONUS_NAME)
bonus : $(BONUS_NAME)
.PHONEY : all fclean clean re bonus