-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (47 loc) · 1.63 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mcloarec <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/07/06 09:45:57 by mcloarec #+# #+# #
# Updated: 2022/08/04 15:35:52 by mcloarec ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
CC = gcc
CFLAGS = -g3 -Wall -Wextra -Werror
SRCS = srcs/main.c
SRCS += srcs/check.c
SRCS += srcs/free.c
SRCS += srcs/error.c
SRCS += srcs/utils.c
SRCS += srcs/stack.c
SRCS += srcs/moves.c
SRCS += srcs/rotate.c
SRCS += srcs/algo.c
SRCS += srcs/index.c
SRCS += srcs/moves_rotate.c
SRCS += srcs/push_swap.c
OBJS = $(SRCS:.c=.o)
RM = rm -f
all: $(NAME)
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
$(NAME): $(OBJS)
@make -sC libft
echo "Libft compilation completed"
$(CC) $(CFLAGS) $(OBJS) -Llibft -lft -o $(NAME)
echo "Push_swap compilation completed"
clean:
@make -sC libft clean
$(RM) $(OBJS)
echo "clean done"
fclean: clean
@make -sC libft fclean
$(RM) $(NAME)
echo "fclean done"
re: fclean all
.SILENT:
.PHONY: all clean fclean re