-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (37 loc) · 870 Bytes
/
Makefile
File metadata and controls
57 lines (37 loc) · 870 Bytes
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
NAME = ircserv
SRC = main.cpp \
error.cpp \
syntax.cpp \
utils.cpp \
connexion.cpp \
messages.cpp \
channels.cpp \
server.cpp \
replies.cpp \
Client.cpp \
Command.cpp \
Message.cpp \
Channel.cpp \
Ircserv.cpp
SRCS = $(addprefix $(DIR_SRCS)/, $(SRC))
OBJS = $(addprefix $(DIR_OBJS)/, $(SRC:%.cpp=%.o))
HEADERS = -I include/
DIR_SRCS = srcs
DIR_OBJS = objs
RM = rm -rf
CC = clang++
FLAGS = -Wall -Werror -Wextra -std=c++98
all: $(NAME)
$(NAME) : $(OBJS)
$(CC) $(HEADERS) $(SRCS) -o $(NAME)
$(OBJS): $(DIR_OBJS)/%.o : $(DIR_SRCS)/%.cpp | $(DIR_OBJS)
@clang++ $(FLAGS) $(HEADERS) -g -c $< -o $@
@echo Compiling : $< "Okay"
$(DIR_OBJS):
@mkdir $(DIR_OBJS)
clean:
$(RM) $(DIR_OBJS)/*.o
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: all, clean, fclean, re, bonus