forked from kslik9/best_webserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (54 loc) · 1.75 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
53
54
55
56
57
58
59
60
61
62
63
64
65
SRCS = src/main.cpp \
src/Server/create_http.cpp \
src/Config/Config.cpp \
src/Logger/Logger.cpp \
src/Server/Server.cpp \
src/ReturnStatus/HttpRequestFlow.cpp \
src/ReturnStatus/Checkers.cpp \
src/ReturnStatus/HandleGetMethod.cpp \
src/ReturnStatus/HandlePostMethod.cpp \
src/ReturnStatus/HandleDeleteMethod.cpp \
src/ReturnStatus/RequestData.cpp \
src/ReturnStatus/Response/NotFound404.cpp \
src/ReturnStatus/Response/MovedPermanently301.cpp \
src/ReturnStatus/Response/MethodNotAllowed405.cpp \
src/ReturnStatus/Response/Conflict409.cpp \
src/ReturnStatus/Response/NoContent204.cpp \
src/ReturnStatus/Response/InternalServerError500.cpp \
src/ReturnStatus/Response/Forbidden403.cpp \
src/ReturnStatus/Response/ResponseFromCgi.cpp \
src/ReturnStatus/Response/OK200.cpp \
src/ReturnStatus/Response/UriTooLong414.cpp \
src/ReturnStatus/Response/BadRequest400.cpp \
src/ReturnStatus/Response/Created201.cpp \
src/ReturnStatus/Response/PayloadTooLarge413.cpp \
src/ReturnStatus/Response/CommonFuncs.cpp \
src/Config/ServConf.cpp \
src/Server/Socket.cpp \
src/utils.cpp
OBJS := $(SRCS:.cpp=.o)
OBJS := $(addprefix obj/, $(OBJS))
CC = c++
RM = rm -f
CFLAGS = -Wall -Wextra -Werror -std=c++98
NAME = webserv
INCLUDE = -Iinc/
FIRST_TIME := false
all: $(NAME)
@echo completed
$(NAME): $(OBJS)
@$(CC) $(CFLAGS) $(OBJS) $(INCLUDE) -o $(NAME)
@echo ${NAME} Created!
obj/%.o: %.cpp
@mkdir -p $(shell dirname $@)
@$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
@echo creating object file ...
clean:
@$(RM) $(OBJS)
@$(RM) -rf obj/
@echo object files removed
fclean: clean
$(RM) $(NAME)
@echo object files and ${NAME} removed
re: fclean all
.PHONY: all clean fclean re