-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (57 loc) · 2.05 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: adamarqu <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/12/03 15:51:51 by adamarqu #+# #+# #
# Updated: 2024/12/03 15:52:09 by adamarqu ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
BONUS_NAME = checker
LIBFT = libft.a
PRINTF = libftprintf.a
SRC_FILES = push_swap.c sort.c Utils_functions.c \
quicksort.c Instructions_1.c Instructions_2.c \
Instructions_3.c Instructions_4.c
BONUS_FILES = checker.c
SRC_DIR = src/
BONUS_DIR = bonus/
SRC = $(addprefix $(SRC_DIR), $(SRC_FILES))
BONUS = $(addprefix $(BONUS_DIR), $(BONUS_FILES))
OBJ = ${SRC:.c=.o}
OBJB = ${BONUS:.c=.o}
OBJBB = ${filter-out src/push_swap.o ,${OBJ}}
CC = gcc
CFLAGS = -Wall -Werror -Wextra -g
FSANITIZE = -fsanitize=address -g3
LDFLAGS = -L $(SRC_DIR)
INCLUDE = -I include
RM = rm -rf
all: $(NAME)
$(NAME) : $(OBJ)
@make -C libft
@cp libft/libft.a .
@make -C printf
@cp printf/libftprintf.a .
$(CC) $(CFLAGS) $(OBJ) $(INCLUDE) $(LIBFT) $(PRINTF) -o $(NAME)
bonus : $(NAME) $(OBJB)
$(CC) $(CFLAGS) $(OBJBB) $(OBJB) $(INCLUDE) $(LIBFT) $(PRINTF) -o $(BONUS_NAME)
clean :
make clean -C libft
make clean -C printf
${RM} ${OBJ}
${RM} ${OBJB}
fclean : clean
@make fclean -C libft
@make fclean -C printf
${RM} $(NAME)
${RM} $(BONUS_NAME)
${RM} $(LIBFT)
${RM} libft/$(PRINTF)
${RM} $(PRINTF)
${RM} printf/$(PRINTF)
re : fclean all
.PHONY: all clean fclean re