-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
48 lines (40 loc) · 1.08 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
NAME = start
FLAGS = -Wall -Wextra -Werror -std=c++98
SRC = ./main.cpp
OBJ=$(SRC:.cpp=.o)
DEBUG = -g
LOG = log_*
#colors
RED=\033[1;31m
GREEN=\033[1;32m
YELLOW=\033[1;33m
CYAN=\033[1;36m
RESET=\033[0m
%.o:%.cpp
@clang++ $(DEBUG) -o $@ -c $< $(FLAGS)
@echo "[$(GREEN)OK$(RESET)]$(YELLOW) Compiling $<$(RESET)"
$(NAME): $(OBJ)
@clang++ -o $(NAME) $(DEBUG) $(OBJ) $(FLAGS)
@echo "[$(GREEN)Success$(RESET)]$(GREEN) Successfully compiled $(NAME) project.$(RESET)"
@echo ""
@echo "$(CYAN) /|/|"
@echo " ( @ @)"
@echo " ) ^ $(RESET) ft_containers (project 2020) $(CYAN)"
@echo " / ||| $(RESET) by ckakuna$(CYAN)"
@echo " / )|||_"
@echo " (_______)$(RESET)"
@echo ""
@echo "$(RED)[For example]:$(RESET)"
@echo "$(YELLOW)./$(NAME) $(RESET)"
@echo ""
all: $(NAME)
clean:
@rm $(OBJ)
@echo "[$(RED)Deleting$(RESET)]$(RED) Object files deleted.$(RESET)"
fclean: clean
@rm $(NAME)
@echo "[$(RED)Deleting$(RESET)]$(RED) $(NAME) deleted.$(RESET)"
@rm $(LOG)
@echo "[$(RED)Deleting$(RESET)]$(RED) $(LOG) deleted.$(RESET)"
re: fclean all
.PHONY: all clean fclean re