-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
82 lines (60 loc) · 1.23 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
76
77
78
79
80
81
82
NAME = webserv
CC = c++
CFLAGS = -Wall -Wextra -std=c++98 -Werror
RM = rm -rf
INC = Engine.hpp\
Socket.hpp\
utils.hpp\
Connect.hpp\
Server.hpp\
Request.hpp\
Response.hpp\
ConfigParser.hpp \
Executer.hpp \
CGI.hpp \
DirectoryListing.hpp
IDIR = inc
INC_FULL = $(addprefix $(IDIR)/, $(INC))
TPP =
TPP_FULL = $(addprefix $(IDIR)/, $(TPP))
SRC = main.cpp\
Socket.cpp\
Engine.cpp\
Server.cpp\
Request.cpp\
Response.cpp\
utils.cpp\
ConfigParser.cpp \
Connect.cpp\
Executer.cpp \
CGI.cpp \
DirectoryListing.cpp
SDIR = src
SRC_FULL = $(addprefix $(SDIR)/, $(SRC))
ODIR = obj
OBJ = $(patsubst $(SDIR)/%.cpp, $(ODIR)/%.o, $(SRC_FULL))
$(NAME): $(ODIR) $(OBJ) $(INC_FULL) $(TPP_FULL)
$(CC) $(CFLAGS) $(OBJ) -o $(NAME) -I $(IDIR)
$(ODIR):
mkdir -p $@
$(ODIR)/%.o: $(SDIR)/%.cpp
$(CC) $(CFLAGS) -c $< -o $@ -I $(IDIR)
all: $(NAME)
clean:
$(RM) $(ODIR)
fclean: clean
$(RM) ./testServerDir/test/uploads/*
$(RM) $(NAME)
re: fclean all
bonus: CFLAGS += -DBONUS=1
bonus: all
debug: CFLAGS += -g -DVERBOSE
debug: re
events: CFLAGS += -g -DVERBOSE_EVENTS
events: re
release: CFLAGS += -Ofast
release: re
docker:
docker build -t webserver .
docker run -p8080:8080 -ti webserver
.PHONY: all clean fclean re bonus debug release docker