-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (45 loc) · 1.35 KB
/
Copy pathMakefile
File metadata and controls
55 lines (45 loc) · 1.35 KB
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
CXX = c++
CXXFLAGS = -Wall -Wextra -Werror -std=c++98 -I. -Iincludes/Config \
-Iincludes/CGI -Iincludes/cookies -Iincludes/HTTP -Iincludes/Socket
NAME = webserv
OBJ_DIR = obj
GREEN = \033[1;32m
YELLOW = \033[1;33m
BLUE = \033[1;34m
RED = \033[1;31m
RESET = \033[0m
SRCS = \
srcs/main.cpp \
srcs/Config/ConfigLexer.cpp \
srcs/Config/ConfigParser.cpp \
srcs/Config/ConfigValidator.cpp \
srcs/Config/HttpConfig.cpp \
srcs/Config/LocationConfig.cpp \
srcs/Config/ServerConfig.cpp \
srcs/HTTP/HttpRequest.cpp \
srcs/HTTP/HttpResponse.cpp \
srcs/HTTP/router.cpp \
srcs/HTTP/URI.cpp \
srcs/CGI/CgiHandler.cpp \
srcs/cookies/Cookie.cpp \
srcs/cookies/Session.cpp \
srcs/Socket/connection.cpp \
srcs/Socket/serversocket.cpp
OBJS = $(addprefix $(OBJ_DIR)/, $(SRCS:.cpp=.o))
all: $(NAME)
$(OBJ_DIR)/%.o: %.cpp
@mkdir -p $(dir $@)
@printf "$(BLUE)Compiling$(RESET) %s\n" $<
@$(CXX) $(CXXFLAGS) -c $< -o $@
$(NAME): $(OBJS)
@printf "$(GREEN)Linking$(RESET) %s\n" $(NAME)
@$(CXX) $(CXXFLAGS) $(OBJS) -o $(NAME)
@printf "$(GREEN)Done$(RESET) %s\n" $(NAME)
clean:
@printf "$(YELLOW)Cleaning$(RESET) objects\n"
@rm -rf $(OBJ_DIR)
fclean: clean
@printf "$(YELLOW)Removing$(RESET) %s\n" $(NAME)
@rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re