-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
42 lines (34 loc) · 976 Bytes
/
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
# Target
NAME = webserv
# Cmd & Options
CXX = c++
CXXFLAGS = -Wall -Werror -Wextra -std=c++98 -g3
RM = rm
RMFLAGS = -f
OUT_DIR = objs
SRC_DIR = srcs
FILE = Client ClientManager \
Server ServerManager \
Config/ConfigParser Config/ConfigFunctions \
Http/Handler/Handler Http/Handler/ErrorHandler Http/Handler/StaticHandler Http/Handler/DynamicHandler Http/Handler/DeleteHandler Http/Handler/RedirectHandler \
Message/Message Message/Request Message/Response \
Event \
Location \
Http/Handler/HttpStatusCodes Http/HttpRequestManager \
main
OBJECTS = $(addprefix $(OUT_DIR)/, $(addsuffix .o, $(FILE)))
# Compile rules
$(OUT_DIR)/%.o : $(SRC_DIR)/%.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(CXXFLAGS) $< -o $@
.PHONY : all no clean fclean re
all : $(NAME)
$(NAME) : $(OBJECTS)
$(CXX) $(CXXFLAGS) $(OBJECTS) -o $(NAME)
clean :
@$(RM) $(RMFLAGS) -r $(OUT_DIR)
fclean : clean
@$(RM) $(RMFLAGS) $(NAME)
re :
@make fclean
@make all