-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (41 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
47
48
49
50
51
52
GREEN = \033[0;32m
RED = \033[0;31m
LIGHT_SKYBLUE_COLOR=\033[36m\033[01m
CLEAR = \033[0m
NAME = Webserv
CC = clang++ -std=c++98
# FLAGS = -Wall -Wextra -Werror -g3 -fsanitize=address
FLAGS = -Wall -Wextra -Werror
DIR_HEADER = ./includes/
DIR_SRC = ./srcs/
SRC = main.cpp \
Server.cpp \
Response.cpp \
Request.cpp \
Uri.cpp \
Utils.cpp \
ServerManager.cpp \
HttpConfig.cpp \
HttpConfigLocation.cpp \
HttpConfigServer.cpp \
Exception.cpp \
Str.cpp
SRCS = $(addprefix $(DIR_SRC), $(SRC))
OBJS = $(SRCS:%.cpp=%.o)
all: $(NAME)
$(NAME): $(OBJS)
@$(CC) $(FLAGS) -I $(DIR_HEADER) $(OBJS) -o $(NAME)
@echo "$(LIGHT_SKYBLUE_COLOR)MAKEFILE DONE$(CLEAR)"
%.o: %.cpp
@$(CC) $(FLAGS) -I $(DIR_HEADER) -c $< -o $@
@echo "$(GREEN)Compiled "$<" successfully!$(CLEAR)"
clean:
@echo "$(RED)rm $(OBJS)$(CLEAR)"
@rm -f $(OBJS)
@echo "$(GREEN)clean successfully!$(CLEAR)"
fclean: clean
@echo "$(RED)rm $(NAME)$(CLEAR)"
@rm -f $(NAME)
@echo "$(GREEN)fclean successfully!$(CLEAR)"
re: fclean all
.PHONY: all clean fclean re