-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (39 loc) · 1.73 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aoizel <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/02/06 14:50:12 by aoizel #+# #+# #
# Updated: 2024/04/08 09:47:58 by aoizel ### ########.fr #
# #
# **************************************************************************** #
NAME = webserv
RAW_SOURCES = main.cpp VirtualServer.cpp Location.cpp WebServ.cpp Socket.cpp utils.cpp HTTPMessage.cpp Client.cpp
SOURCES_DIR = srcs/
SOURCES = $(addprefix $(SOURCES_DIR),$(RAW_SOURCES))
INCLUDES_DIR = includes/
CXX = c++
CPP_FLAGS = -Wall -Wextra -Werror -std=c++98
OBJECTS_DIR = .objs/
OBJECTS = $(addprefix $(OBJECTS_DIR),$(RAW_SOURCES:.cpp=.o))
DEPENDENCIES = Makefile
DEPS = $(OBJECTS:.o=.d)
CPP = $(CXX) $(CPP_FLAGS)
all: $(OBJECTS_DIR) $(DEPDIR)
make $(NAME)
$(NAME): $(OBJECTS_DIR) $(OBJECTS)
$(CPP) $(OBJECTS) -o $@
$(OBJECTS_DIR):
mkdir -p $@
$(OBJECTS_DIR)%.o: $(SOURCES_DIR)%.cpp $(DEPENDENCIES)
$(CPP) -c -MMD $< -I$(INCLUDES_DIR) -o $@
clean:
rm -rf $(OBJECTS_DIR)
fclean: clean
rm -rf $(NAME)
re: fclean
make all
.PHONY: all clean fclean re
-include $(DEPS)