-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.52 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vberdugo <vberdugo@student.42barcelon +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/08/24 14:14:03 by vberdugo #+# #+# #
# Updated: 2024/09/10 19:45:06 by victor ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
LIBFT_DIR = libft
LIBFT = $(LIBFT_DIR)/libft.a
INCLUDE = libft/libft.h push_swap.h
SRC = push_swap.c split.c push.c rev_rotate.c rotate.c swap.c \
setup_lst_a.c setup_lst_b.c stack_utils.c sort_stacks.c sort_three.c
OBJ = $(SRC:.c=.o)
CC = cc
CFLAGS = -Wall -Wextra -Werror -I$(LIBFT_DIR)
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ)
$(CC) $(CFLAGS) -o $(NAME) $(OBJ) $(LIBFT)
$(LIBFT):
@make -C $(LIBFT_DIR)
%.o: %.c push_swap.h
$(CC) $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJ) $(TEST_OBJ)
$(MAKE) -C $(LIBFT_DIR) clean
fclean: clean
rm -f $(NAME)
$(MAKE) -C $(LIBFT_DIR) fclean
re: fclean all
.PHONY: all clean fclean re test