-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
64 lines (45 loc) · 1.78 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: doreshev <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/11/26 23:28:55 by hoomen #+# #+# #
# Updated: 2023/02/15 17:56:43 by hoomen ### ########.fr #
# #
# **************************************************************************** #
NAME := webserv
CXX := c++
CXXFLAGS := -Wall -Werror -Wextra -std=c++98
DEPFLAGS = -MT $@ -MMD -MP -MF $(DDIR)/$*.d
INCFLAGS = -I incl
VPATH = src
SRC = CGI.cpp CLI.cpp Config.cpp ConfigParser.cpp DELETERequest.cpp \
Env.cpp GETRequest.cpp main.cpp POSTRequest.cpp ResponseGenerator.cpp \
Server.cpp Socket.cpp tools.cpp Session.cpp request_handler.cpp RequestParser.cpp \
Chunks.cpp \
ODIR = obj
OBJ = $(SRC:%.cpp=$(ODIR)/%.o)
DDIR = $(ODIR)/.deps
DEP = $(SRC:%.cpp=$(DDIR)/%.d)
.PHONY : all clean fclean re run bonus
$(NAME) : $(OBJ)
$(CXX) $(CXXFLAGS) $(OBJ) -o $@
$(ODIR)/%.o : %.cpp $(DDIR)/%.d | $(ODIR) $(DDIR)
$(CXX) $(CXXFLAGS) $(DEPFLAGS) $(INCFLAGS) -c $< -o $@
$(ODIR) :
mkdir $@
$(DDIR) :
mkdir $@
all : $(NAME)
clean :
$(RM) -r $(DDIR) $(ODIR)
fclean : clean
$(RM) $(NAME)
re : fclean all
run : $(NAME)
./$(NAME) config/vs_code.conf
bonus: all
$(DEP):
-include $(DEP)