-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
45 lines (28 loc) · 935 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
42
43
44
45
SRC_FILE = main.cpp \
src/Client.cpp src/Channel.cpp src/Server.cpp src/Error.cpp src/Parsing.cpp \
src/Parser.cpp src/Registration.cpp src/Privmsg.cpp src/Join.cpp \
src/mode.cpp src/Part.cpp src/Kick.cpp src/Quit.cpp src/Topic.cpp
OBJ_FILE = $(SRC_FILE:.cpp=.o)
NAME = ircserv
RED = \033[0;31
YELLOW = \033[0;33m
BLUE=\033[0;34m
RESET = \033[0m
GREEN=\033[0;32m
INCLUDE = $(wildcard includes/*.hpp)
CC = c++
CFLAGS = -Wextra -Wall -Werror -std=c++98 -fsanitize=address
all:$(NAME)
%.o:%.cpp $(INCLUDE)
@$(CC) $(CFLAGS) -c $< -o $@ -g
@echo "[$(GREEN) OK $(RESET)]$(YELLOW) Compiling $<$(RESET)"
$(NAME) : $(OBJ_FILE)
@$(CC) $(CFLAGS) $(OBJ_FILE) -o $(NAME) -g
clean :
@rm -rf $(OBJ_FILE)
@echo "[$(GREEN) OK $(RESET)]$(YELLOW) Object files deleted$(RESET)"
fclean :
@rm -rf $(OBJ_FILE) $(NAME)
@echo "[$(GREEN) OK $(RESET)]$(YELLOW) $(NAME) deleted$(RESET)"
re : fclean all
.PHONY : clean fclean re