-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (52 loc) · 1.82 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: antthoma <antthoma@student.42sp.org.br> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/02/20 23:33:47 by antthoma #+# #+# #
# Updated: 2023/04/26 00:03:36 by antthoma ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
HEADER = $(NAME).h
FILES = \
srcs/stack_array_utils.c \
srcs/stack_array_core.c \
srcs/sort_array_utils2.c \
srcs/sort_array_utils.c \
srcs/sort_array_core.c \
srcs/push_swap_utils.c \
srcs/push_swap_core.c \
srcs/sort_three_elements.c \
srcs/sort_four_elements.c \
srcs/sort_five_elements.c \
srcs/main.c
OBJS = $(FILES:.c=.o)
CC = gcc
CC_ARGS = -Wextra -Wall -Werror -g3
LIBS = libs
all: $(NAME)
$(NAME): $(OBJS)
$(CC) $(CC_ARGS) $(OBJS) -L $(LIBS) -lft -o $(NAME)
ar rsc $(LIBS)/lib$(NAME).a $(OBJS)
%.o: %.c
mkdir -p libs
make -C libft
cp -a libft/libft.h ./includes/
cp -a libft/libft.a ./libs/
gcc $(CC_ARGS) -c $< -o $@
test: all
@make -C tests
debug:
$(CC) $(CC_ARGS) -g $(FILES) -L $(LIBS) -lft -o srcs/$(NAME)
clean:
make -C libft clean
rm $(OBJS)
fclean: clean
make -C libft fclean
rm push_swap
rm $(LIBS)/libft.*
re: fclean all
.PHONY: all clean fclean re