-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (30 loc) · 842 Bytes
/
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
CC = c++ -Wall -Wextra -Werror -std=c++98 #-g -fsanitize=address
RM = rm -rf
NAME = ./ft_containers
NAME_SHORT = ft_containers
INC_DIR = include
MAIN_INC = -I$(INC_DIR)
INC = $(shell find $(INC_DIR) -type f -name "*.hpp")
SRC_DIR = src
SRC = $(shell find $(SRC_DIR) -type f -name "*.cpp")
OBJ = $(SRC:.cpp=.o)
_COLOR = \033[32m
_BOLDCOLOR = \033[32;1m
_RESET = \033[0m
_CLEAR = \033[0K\r\c
_OK = [\033[32mOK\033[0m]
%.o : %.cpp
@echo "[..] $(NAME_SHORT)... compiling $*.cpp\r\c"
@$(CC) $(MAIN_INC) -c $< -o $@
@echo "$(_CLEAR)"
all : $(NAME)
$(NAME) : $(OBJ) $(INC)
@$(CC) $(OBJ) $(MAIN_INC) -o $(NAME)
@echo "$(_OK) $(NAME_SHORT) compiled"
clean :
@$(RM) $(OBJ)
fclean : clean
@$(RM) $(NAME)
@$(RM) std_output.txt ft_output.txt a.out
re : fclean all
.PHONY : all clean fclean re