-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
47 lines (35 loc) · 787 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
43
44
45
46
47
NAME = webserv
CXX = c++
CXXFLAGS = -Wall -Wextra -Werror -std=c++98 -I $(INCLUDES)
OBJDIR = ./objs/
SRCDIR = ./srcs/
INCLUDES = ./includes/
SRCS = main.cpp \
Server.cpp \
HttpError.cpp \
HttpParser.cpp \
ConState.cpp \
Buf.cpp \
ChunkStreamer.cpp \
Writer.cpp \
Conf.cpp \
Quit.cpp \
CgiHandler.cpp \
path_utils.cpp
OBJS = ${addprefix $(OBJDIR), $(SRCS:%.cpp=%.o)}
# ==== #
$(OBJDIR)%.o: $(SRCDIR)%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
all: $(NAME)
$(NAME): $(OBJDIR) $(OBJS)
$(CXX) $(CXXFLAGS) $(OBJS) -o $(NAME)
$(OBJDIR):
@mkdir -p $(OBJDIR)
clean: purge
rm -rf $(OBJDIR)
fclean: clean
rm -f $(NAME)
re: fclean $(NAME)
purge:
rm -f /tmp/webserv_*
.PHONY: clean fclean re objs all purge