-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (58 loc) · 1.89 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: xinzhang <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/05/26 23:35:02 by xinzhang #+# #+# #
# Updated: 2019/05/26 23:35:03 by xinzhang ### ########.fr #
# #
# **************************************************************************** #
.PHONY: all clean fclean re
NAME = push_swap
# NAME2 = checker
# CHECHER_F = checker/
LIBFT_F = ps_libft/
LIBFT = libft.a
OUT = ./
CFILES = test_main.c
CFILES += action.c
CFILES += eval.c
CFILES += eval_help.c
CFILES += free.c
CFILES += genaction.c
CFILES += genoptimizer.c
CFILES += initstack.c
CFILES += instruction.c
CFILES += isfinished.c
CFILES += move.c
CFILES += p_op.c
CFILES += r_op.c
CFILES += rr_op.c
CFILES += s_op.c
CFILES += score.c
CFILES += searching_a.c
CFILES += searching_b.c
CFILES += sort_small.c
CFILES += stack_info.c
CFILES += strategy_build.c
OFILES = $(CFILES:.c=.o)
all: $(NAME)
$(NAME):
@if [ ! -e $(LIBFT_F)$(LIBFT) ]; then \
echo "make re $(LIBFT)"; \
make re -C $(LIBFT_F); \
fi
@if [ -e $(LIBFT_F)$(LIBFT) ]; then \
echo "$(NAME) is compiling"; \
gcc -Wall -Wextra -Werror -c $(CFILES); \
gcc -Wall -Wextra -Werror $(OFILES) $(LIBFT_F)$(LIBFT) -o $(NAME); \
else \
echo "something wrong with $(LIBFT)"; \
fi
clean:
@rm -rf $(OFILES)
fclean: clean
@rm -f $(NAME)
re: fclean all