-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (30 loc) · 888 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
NAME := ircserv
CXX := c++
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -g3 -fsanitize=address
RM := rm
RMFLAGS := -rf
SRCDIR := ./srcs/
SRCNAME := Client.cpp Command.cpp CommandInvoker.cpp Join.cpp Pass.cpp\
Kick.cpp Nick.cpp Notice.cpp Part.cpp Privmsg.cpp Pong.cpp\
Quit.cpp Server.cpp User.cpp main.cpp Channel.cpp
SRCS := $(addprefix $(SRCDIR), $(SRCNAME))
OBJDIR := ./obj/
OBJNAME := $(SRCNAME:.cpp=.o)
OBJS := $(addprefix $(OBJDIR), $(OBJNAME))
INCDIR := includes/
.PHONY : all
all : $(NAME)
$(NAME) : $(OBJS)
$(CXX) $(CXXFLAGS) -I$(INCDIR) $^ -o $@
.PHONY : clean
clean :
$(RM) $(RMFLAGS) $(OBJS)
$(RM) $(RMFLAGS) $(OBJDIR)
.PHONY : fclean
fclean : clean
$(RM) $(RMFLAGS) $(NAME)
.PHONY : re
re : fclean all
$(OBJDIR)%.o:$(SRCDIR)%.cpp
@mkdir -p $(OBJDIR)
$(CXX) $(CXXFLAGS) -c $< -o $@