-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
82 lines (60 loc) · 1.97 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: rtroll <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/01/23 19:34:02 by rtroll #+# #+# #
# Updated: 2019/02/09 17:27:44 by rtroll ### ########.fr #
# #
# **************************************************************************** #
NAME = checker
NAME2 = push_swap
SRC = checker_main.c\
stack_functions.c\
error_functions.c\
moves.c\
moves_2.c\
operations.c\
get_commands.c
SRC2 = push_swap_main.c\
quicksort.c\
moves_ps.c\
moves_2_ps.c\
sort.c\
sort_b.c\
sort_three_a.c\
sort_seven.c\
sort_seven_b.c\
sort_help_functions.c\
optimaze.c
OBJ = $(SRC:.c=.o)
OBJ2 = $(SRC2:.c=.o)
SRC_PATH = src/
SRC_POS = $(addprefix $(SRC_PATH), $(SRC))
SRC_POS2 = $(addprefix $(SRC_PATH), $(SRC2))
INC = -I include
LIBFT = src/libft/libft.a
CC = gcc
FLAGS = -Wall -Werror -Wextra
all: $(NAME) $(NAME2)
$(NAME): $(LIBFT) $(OBJ)
@$(CC) $(FLAGS) $(OBJ) -o $(NAME) $(LIBFT)
$(OBJ): $(LIBFT)
@$(CC) $(FLAGS) -c $(SRC_POS) $(INC)
$(NAME2): $(LIBFT) $(OBJ2)
@$(CC) $(FLAGS) $(OBJ2) moves_2.o error_functions.o stack_functions.o -o $(NAME2) $(LIBFT)
$(OBJ2): $(LIBFT)
@$(CC) $(FLAGS) -c $(SRC_POS2) $(INC)
$(LIBFT):
@make -C ./src/libft/
clean:
@rm -f $(OBJ)
@rm -f $(OBJ2)
@make clean -C ./src/libft/
fclean: clean
@rm -f $(NAME)
@rm -f $(NAME2)
@make fclean -C ./src/libft
re: fclean all