-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 819 Bytes
/
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
NAME = push_swap
AR_NAME = push_swap.a
CFLAGS = -Wall -Wextra -Werror
AR = ar rcs
RM = rm -rf
LIBFT_PATH = libft/
LIBFT = $(LIBFT_PATH)libft.a
SRCS = src/push_swap.c src/sort_stack.c src/init_a_to_b.c src/init_b_to_a.c \
src/utils/check.c src/utils/find_node.c src/utils/free_and_error.c \
src/utils/utils.c src/utils/stack_utils.c src/moves/push.c src/moves/swap.c \
src/moves/rotate.c src/moves/rev_rotate.c src/split.c
OBJS = $(SRCS:.c=.o)
all: $(NAME)
$(NAME): $(LIBFT) $(OBJS)
cc $(CFLAGS) -I $(LIBFT_PATH) $(OBJS) $(LIBFT) -o $(NAME)
$(LIBFT):
make -s -C $(LIBFT_PATH)
$(AR_NAME): $(LIBFT) $(OBJS)
$(AR) $(AR_NAME) $(OBJS)
clean:
make -s -C $(LIBFT_PATH) clean
$(RM) $(OBJS)
fclean: clean
make -s -C $(LIBFT_PATH) fclean
$(RM) $(NAME)
$(RM) $(AR_NAME)
re: fclean all
.PHONY: all clean fclean re