-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (57 loc) · 1.69 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
68
69
70
71
# Project compilation files and directories
NAME = ircserv
SRCS = main.cpp \
Server.cpp \
User.cpp \
utils.cpp \
Command.cpp \
Channel.cpp \
commands/Pass.cpp \
commands/Nick.cpp \
commands/Username.cpp \
commands/Privmsg.cpp \
commands/Ping.cpp \
commands/Pong.cpp \
commands/Mode.cpp \
commands/Quit.cpp \
commands/ChannelJoin.cpp \
commands/ChannelPart.cpp \
commands/ChannelKick.cpp \
commands/ChannelInvite.cpp \
commands/ChannelTopic.cpp \
commands/ChannelNames.cpp \
commands/ChannelList.cpp
SRCSFD = srcs/
OBJSFD = objs/
HDR_INC = -I./includes
# # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Compilation
CFLAGS = -Wall -Wextra -Werror -std=c++98
# # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Colors
RED = \033[0;31m
GREEN = \033[0;32m
NONE = \033[0m
# # # # # # # # # # # # # # # # # # # # # # # # # # # # #
all: project $(NAME)
@echo "... project ready"
project:
@echo "Checking project ..."
$(OBJSFD):
@mkdir -p $@/commands
@echo "\t[ $(GREEN)✔$(NONE) ] $@ directory"
$(NAME): $(OBJSFD) $(SRCS:%.cpp=$(OBJSFD)%.o)
@clang++ $(CFLAGS) $(SRCS:%.cpp=$(OBJSFD)%.o) -o $@
@echo "\t[ $(GREEN)✔$(NONE) ] $(NAME) executable"
$(OBJSFD)%.o: $(SRCSFD)%.cpp
@clang++ $(CFLAGS) $(HDR_INC) -c $< -o $@
@echo "\t[ $(GREEN)✔$(NONE) ] $@ object"
clean:
@echo "Cleaning project ..."
@/bin/rm -rf $(OBJSFD)
@echo "\t[ $(RED)✗$(NONE) ] Objects directory"
fclean: clean
@/bin/rm -f $(NAME)
@echo "\t[ $(RED)✗$(NONE) ] $(NAME) executable deleted"
re: fclean all
.PHONY: project all clean fclean re