-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
73 lines (54 loc) · 2.11 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: coskelet <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/02/23 15:37:41 by coskelet #+# #+# #
# Updated: 2022/03/07 17:24:39 by coskelet ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
HEADER = push_swap.h
SRCS = sorter.c boundaries_comparator.c boundaries_finder.c \
push_swap_engine.c push_swap_ra.c push_swap_rra.c \
stack_constructor.c stack_utils.c stack_comparator.c \
stack_mover_back.c stack_mover_swap.c stack_move_to.c \
move_swap.c move_push.c move_rotate.c move_rrotate.c
SRC_CHK = checker.c stack_constructor.c stack_utils.c \
move_swap.c move_push.c move_rotate.c move_rrotate.c
LIBFT = libft
CHECKER = checker
.PHONY: all clean fclean re bonus
OBJS = ${SRCS:.c=.o}
OBJCHK = ${SRC_CHK:.c=.o}
%o : %c ${HEADER}
${CC} ${CFLAGS} -c $< -o $@
CC = cc
RM = rm -rf
AR = ar -rcs
CFLAGS = -Wall -Wextra -Werror
SANIT = -g -fsanitize=address
$(NAME): ${OBJS} ${LIBFT}.a
${CC} ${CFLAGS} ${SANIT} ${OBJS} -L ./${LIBFT} -lft -o $@
$(CHECKER): ${OBJCHK} ${LIBFT}.a
${CC} ${CFLAGS} ${SANIT} ${OBJCHK} -L ./${LIBFT} -lft -o $@
$(LIBFT).a:
@make -C ${LIBFT}
@cp ${LIBFT}/${LIBFT}.a ./${LIBFT}.a
%o : %c ${HEADER}
${CC} ${CFLAGS} -c $< -o $@
bonus: ${CHECKER}
all: ${NAME}
clean:
${RM} ${OBJS}
${RM} ${OBJCHK}
@make clean -C ${LIBFT}
fclean: clean
${RM} ${NAME}
${RM} ${CHECKER}
${RM} ${LIBFT}.a
@make fclean -C ${LIBFT}
re: fclean
${NAME}