-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
executable file
·46 lines (33 loc) · 1.02 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
CC=c++
# Debug levels
# 0 - DEBUG
# 1 - INFO
# 2 - WARNING
# 3 - ERROR
CFLAGS= -Wall -Wextra -Werror -DDEBUG=1 -g -MD -std=c++98
NAME= webserv
SRC_DIR= src
OBJ_DIR= obj
INC_DIR= includes
SRC_FILES = main.cpp config/ServerConfig.cpp config/LocationConfig.cpp \
HttpRequest.cpp HttpResponse.cpp HttpStatus.cpp MimeTypes.cpp \
fileValidate/fileValidate.cpp utils.cpp ICgiExecutor.cpp \
cgi/BinCgiExecutor.cpp config/ParseConfig.cpp PollManager/PollManager.cpp \
Client/Client.cpp Webserv.cpp
SRC= $(addprefix $(SRC_DIR)/, $(SRC_FILES))
OBJ= $(addprefix $(OBJ_DIR)/, $(SRC_FILES:.cpp=.o))
all: $(NAME)
-include $(OBJ:.o=.d)
$(NAME): $(OBJ)
@$(CC) $(CFLAGS) $(OBJ) -o $(NAME)
@echo "\033[32m[✔] $(NAME) created successfully!\033[0m"
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(shell dirname $@)
@$(CC) $(CFLAGS) -I $(INC_DIR) -c $< -o $@
clean:
@rm -rf $(OBJ_DIR)
@echo "\033[31m[✘] $(NAME) objects removed!\033[0m"
fclean: clean
@rm -f $(NAME)
@echo "\033[31m[✘] $(NAME) removed!\033[0m"
re: fclean all