-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
75 lines (60 loc) · 1.44 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
72
73
74
75
CC = c++
CFLAGS = -g3 -Wall -Wextra -Werror -std=c++98 -pedantic
CFLAGS += -MMD -MP
INCPATH = -I./sources -I./sources/response -I./sources/request
INCPATH += -I./sources/server -I./sources/utils
NAME = webserv
SRC = main.cpp \
WebServ.cpp \
ResponseBase.cpp \
Request.cpp \
RequestParser.cpp \
Pollfd.cpp \
Server.cpp \
ServerLocation.cpp \
Config.cpp \
Logger.cpp \
Response.cpp \
LoadException.cpp \
validate_input.cpp \
signal.cpp \
String.cpp \
ConfigHelper.cpp \
INC = defines.hpp \
WebServ.hpp \
ResponseBase.hpp \
Request.hpp \
RequestParser.hpp \
Pollfd.hpp \
Server.hpp \
ServerLocation.hpp \
Config.hpp \
Logger.hpp \
Response.hpp \
LoadException.hpp \
validate_input.hpp \
signal.hpp \
String.hpp \
ConfigHelper.hpp \
OBJDIR = objects
OBJ = $(SRC:%.cpp=$(OBJDIR)/%.o)
DEPS = $(SRC:%.cpp=$(OBJDIR)/%.d)
vpath %.cpp sources sources/response sources/server sources/request \
sources/utils
vpath %.hpp sources sources/response sources/server sources/request \
sources/utils
all: $(NAME)
$(NAME): $(OBJDIR) $(OBJ)
$(CC) $(CFLAGS) $(OBJ) -o $(NAME)
dep:
which php-cgi || (sudo apt-get update && sudo apt-get install php-cgi)
$(OBJDIR)/%.o: %.cpp
$(CC) $(CFLAGS) -c $< -o $@ $(INCPATH)
clean:
rm -rf $(OBJDIR)
fclean: clean
rm -rf $(NAME)
$(OBJDIR):
mkdir -p objects
re: fclean all
-include $(DEPS)