-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (23 loc) · 781 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
NAME := webserv
CPP := c++
INCLUDES := -I./includes
CXXFLAGS := -std=c++98 -Wall -Wextra -Werror -g $(INCLUDES)
# ------------------------------- Source files ------------------------------- #
OBJ_DIR := ./objs
VPATH := ./src/
SRC := main.cpp SocketManager.cpp HTTPRequest.cpp HTTPResponse.cpp ConfigManager.cpp Logger.cpp utils.cpp
SRCS := $(SRC)
OBJS := $(addprefix $(OBJ_DIR)/, $(SRCS:.cpp=.o))
all: $(NAME)
$(NAME): $(OBJS)
$(CPP) $(CXXFLAGS) $(OBJS) -o $(NAME)
$(OBJ_DIR)/%.o: %.cpp | $(OBJ_DIR)
$(CPP) $(CXXFLAGS) -c $< -o $@
$(OBJ_DIR):
mkdir -p $@
clean:
rm -f $(OBJS)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re