This repository has been archived by the owner on Feb 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
67 lines (56 loc) · 1.56 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
NAME = push_swap
CHECKER = checker
CC = cc
CFLAGS = -Wall -Werror -Wextra -fsanitize=address -fno-omit-frame-pointer
INCLUDES_PATH = includes/
SRC_PATH = sources/
LIBFT_PATH = Libft/
INCLUDES = $(INCLUDES_PATH)push_swap.h
SRC_FILES = main.c \
stack_init.c \
node_operations.c \
utils.c \
push.c \
swap.c \
rotate.c \
reverse_rotate.c \
small_sort.c \
sorting.c \
indexes.c \
radix_sort.c \
atol.c
SRC = $(addprefix $(SRC_PATH), $(SRC_FILES))
OBJ = $(SRC:.c=.o)
CHECKER_FILES = checker.c \
utils.c \
stack_init.c \
node_operations.c \
atol.c \
push.c \
swap.c \
rotate.c \
reverse_rotate.c
CHECKER_SRC = $(addprefix $(SRC_PATH), $(CHECKER_FILES))
CHECKER_OBJ = $(CHECKER_SRC:.c=.o)
LIBFT = $(LIBFT_PATH)libft.a
all: $(NAME) $(CHECKER)
$(NAME): $(INCLUDES) $(OBJ)
@echo "\033[95m \033[1m (ノ◕ヮ◕)ノ*:・゚✧ Compiling... Wait a sec \033[0m"
@$(CC) $(CFLAGS) $(OBJ) $(LIBFT) -o $(NAME)
@echo "\033[95m \033[1m (づ。◕‿‿◕。)づ $(NAME) is generated! \033[0m"
%.o: %.c $(INCLUDES) $(LIBFT)
@$(CC) $(CFLAGS) -I $(INCLUDES_PATH) -c $< -o $@
$(CHECKER): $(INCLUDES) $(CHECKER_OBJ)
@$(CC) $(CFLAGS) $(CHECKER_OBJ) $(LIBFT) -o $(CHECKER)
$(LIBFT):
@$(MAKE) -C $(LIBFT_PATH)
clean:
@rm -rf $(OBJ) $(CHECKER_OBJ)
@$(MAKE) clean -C $(LIBFT_PATH)
@echo "\033[95m \033[1m (⊙﹏⊙) Object files are removed! \033[0m"
fclean: clean
@rm -rf $(NAME) $(CHECKER)
@$(MAKE) fclean -C $(LIBFT_PATH)
@echo "\033[95m \033[1m (∩︵∩) $(NAME) is removed! \033[0m"
re: fclean all
.PHONY: all clean fclean re