-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
66 lines (49 loc) · 1.97 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aizsak <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/12/10 12:41:39 by aizsak #+# #+# #
# Updated: 2023/02/09 09:43:09 by aizsak ### ########.fr #
# #
# **************************************************************************** #
NAME = push_swap
SRC_DIR = src
BIN_DIR = bin
SRC = $(SRC_DIR)/cmd1.c \
$(SRC_DIR)/cmd2.c \
$(SRC_DIR)/main.c \
$(SRC_DIR)/parsing.c \
$(SRC_DIR)/sorting.c \
$(SRC_DIR)/sorting_for_n.c \
$(SRC_DIR)/utils1.c \
$(SRC_DIR)/utils.c \
OBJ = $(SRC:$(SRC_DIR)/%.c=$(BIN_DIR)%.o)
LIB_PATH = ./libft
LIB = -Llibft -lft
INCLUDES = ./includes
CFLAGS = -Wall -Werror -Wextra -I$(INCLUDES)
all : $(BIN_DIR) $(NAME)
$(OBJ) : $(BIN_DIR)%.o: $(SRC_DIR)/%.c
@ $(CC) -I$(INCLUDES) -c $< -o $@
$(NAME) : $(BIN_DIR) $(OBJ)
@ $(MAKE) -s -C $(LIB_PATH)
@ $(CC) $(CFLAGS) $(OBJ) $(LIB) -o $(NAME)
@ echo "\e[33m\e[1m\tMake\e[0m [🗿] : \e[1mDone ! ✅"
$(BIN_DIR) :
@ mkdir -p $(BIN_DIR)
clean :
@ $(MAKE) -s clean -C $(LIB_PATH)
@ rm -f $(OBJ)
@ rm -rf $(BIN_DIR)
@echo "\e[33m\e[1m\tMake\e[0m [🗿] : \e[1mRemove binary files .. 🧹"
fclean : clean
@ $(MAKE) -s fclean -C $(LIB_PATH)
@ rm -f $(NAME)
@echo "\e[33m\e[1m\tMake\e[0m [🗿] : \e[1mRemove executable .. 🗑️"
re :
@echo "\e[33m\e[1m\tMake\e[0m [🗿] : \e[1mRecompile .. 🔄"
@ $(MAKE) -s fclean all
.PHONY: all clean fc