-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (37 loc) · 1.1 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
NAME = webserv
CC = clang++
CFLAGS = -Wall -Werror -Wextra -std=c++98 -pedantic
UNUSED = -Wno-unused-variable -Wno-unused-parameter -Wno-unused-function -Wno-unused-private-field
SDIR = src
ODIR = obj
IDIR = inc
CLASSES = Server Parser Config ServerConfig LocationConfig StringUtils WebServer Task Client Request Response CGI
_OBJS = main $(CLASSES)
OBJS = $(addsuffix .o, $(addprefix $(ODIR)/, $(_OBJS)))
HEADERS = $(addsuffix .hpp, $(addprefix $(IDIR)/, $(CLASSES)))
ifeq ($(DEBUG),1)
CFLAGS += -fsanitize=address -g3
endif
.PHONY: all clean fclean re debug test
all: $(NAME)
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $(OBJS) -o $(NAME)
$(ODIR)/%.o: $(SDIR)/%.cpp $(HEADERS)
@mkdir -p $(ODIR)
$(CC) $(CFLAGS) -I$(IDIR) -c $< -o $@
clean:
$(RM) $(OBJS)
$(RM) *.dSYM
fclean: clean
$(RM) $(NAME)
$(RM) -rf .vscode
re: fclean all
debug:
@make DEBUG=1
test: all
clear
./$(NAME)
chunk:
curl -X POST -H "Transfer-Encoding: chunked" -H Expect: -F 'file=@inc/Parser.hpp' localhost:8000/post/upload2.php
upload:
curl -X POST -H Expect: -F 'file=@inc/Parser.hpp' localhost:8000/post/upload2.php