-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (50 loc) · 1.32 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
# Webserv
NAME = webserv
WEB_SRC = src/cgi.cpp \
src/utils.cpp \
src/webserv.cpp \
src/getFile.cpp \
src/parseReq.cpp \
src/contentType.cpp \
src/model/Server.cpp \
src/model/Socket.cpp \
src/model/Request.cpp \
src/model/PostReq.cpp \
src/model/Location.cpp \
src/configFile/parse.cpp \
src/configFile/splitDirectives.cpp \
src/response/Get.cpp \
src/response/Post.cpp \
src/response/Delete.cpp \
src/response/Response.cpp \
src/response/DefaultPages.cpp \
OBJS = $(WEB_SRC:.cpp=.o)
# Compiler
CXX = c++
RM = rm -f
CXXFLAGS = -Wall -Werror -Wextra -std=c++98 #-g3 -fsanitize=address
# Colours
RED = \033[0;31m
GREEN = \033[0;32m
YELLOW = \033[0;33m
BLUE = \033[0;34m
PURPLE = \033[0;35m
CYAN = \033[0;36m
WHITE = \033[0;37m
RESET = \033[0m
# Rules
all: $(NAME)
@printf "$(BLUE)==> $(CYAN)Webserv compiled ✅\n\n$(RESET)"
$(NAME): $(OBJS)
@$(CXX) $(CXXFLAGS) $(OBJS) -o $(NAME)
clean:
@$(RM) $(OBJS)
@printf "\n$(BLUE)==> $(RED)Removed Webserv 🗑️\n$(RESET)"
fclean: clean
@$(RM) $(NAME)
re: fclean all
@printf "$(BLUE)==> $(CYAN)Webserv recompiled 🔄\n$(RESET)"
docker:
@docker build --rm -t nginx-test .
@docker run --rm -it -p 80:8080 nginx-test
.PHONY: all clean fclean re docker