-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (42 loc) · 1.74 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: vismaily <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/10/28 12:59:24 by vismaily #+# #+# #
# Updated: 2022/12/08 19:30:46 by vismaily ### ########.fr #
# #
# **************************************************************************** #
NAME = webserv
TMP = Tmp
SRCS_COMM = $(wildcard ./Srcs/*.cpp)
SRCS_PARS = $(wildcard ./Srcs/Parsing/*.cpp)
SRCS = $(SRCS_COMM) $(SRCS_PARS)
OBJS = $(patsubst ./Srcs/%.cpp, ./$(TMP)/%.o, $(SRCS_COMM)) \
$(patsubst ./Srcs/Parsing/%.cpp, ./$(TMP)/%.o, $(SRCS_PARS)) \
CPP = c++
CPP_FLAGS = -Wall -Wextra -Werror -std=c++98
BONUS_PART = 0
DEFINES = -D BONUS=$(BONUS_PART)
INCLUDES = -I ./Includes
RM = rm -rf
$(NAME): $(TMP) $(OBJS)
@$(CPP) -o $(NAME) $(OBJS)
$(TMP):
@$(shell mkdir $(TMP))
$(TMP)/%.o: Srcs/%.cpp
@$(CPP) $(CPP_CFLAGS) $(DEFINES) $(INCLUDES) -o $@ -c $<
$(TMP)/%.o: Srcs/Parsing/%.cpp
@$(CPP) $(CPP_CFLAGS) $(DEFINES) $(INCLUDES) -o $@ -c $<
bonus: bonus_on $(NAME)
bonus_on:
$(eval BONUS_PART = 1)
all: bonus
clean:
@$(RM) $(TMP)
fclean: clean
@$(RM) $(NAME) temp
re: fclean $(NAME)
.PHONY: all clean fclean re bonus