-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
98 lines (70 loc) · 1.53 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
##
## EPITECH PROJECT, 2022
## myftp
## File description:
## Makefile
##
TARGET := plazza
CXX := g++
ifneq ("$(wildcard /bin/ccache)","")
CXX := ccache g++
endif
ifneq ("$(wildcard /bin/firefox)","")
BROWSER := firefox
endif
ifneq ("$(wildcard /bin/chromium)","")
BROWSER := chromium
endif
DOC_DEPS := $(wildcard docs/doxygen/html/)
CXXFLAGS := -Wall -Wextra --std=c++20
##-Werror
ifeq ("${ENV}", "dev")
CXXFLAGS += -g3
else
ifeq ("${ENV}", "staging")
CXXFLAGS += -O2 -g3
else
CXXFLAGS += -O2
endif
endif
VPATH := src:inc
DEPS := $(wildcard inc/*.hpp)
SRC := main.cpp \
PlazzaCore.cpp \
ParseArg.cpp \
AProcess.cpp \
load_balancer.cpp \
Kitchen.cpp \
Fifo.cpp \
AIPC.cpp \
PlazzaIpc.cpp \
Pizza.cpp \
Reception.cpp \
Cook.cpp \
Logger.cpp
OBJDIR := obj
OBJ := $(patsubst %.cpp, $(OBJDIR)/%.o, $(SRC))
LDFLAGS := -I inc -I inc/interfaces -pthread
all: $(TARGET)
@echo -e "\e[32mlinking compliete\e[39m"
$(TARGET): $(OBJ)
$(CXX) -o $@ $(OBJ) $(LDFLAGS)
$(OBJDIR)/%.o: src/%.cpp $(DEPS)
@$(CXX) -c -o $@ $(CXXFLAGS) $< $(LDFLAGS)
@echo -e "\t\e[36mCompilate \e[3;97;4m$@\e[00m; \e[1;92mSUCCES\e[00m"
clean:
@echo -e "\e[33m-->Cleaning time\e[00m"
rm -f $(OBJ)
fclean: clean
rm -f $(TARGET)
rm -rf docs/doxygen/html
rm -f docs.html
re: fclean all
build_docs: $(DEPS)
doxygen docs/doxygen/doxygen.conf
ln -rsf docs/doxygen/html/index.html docs.html
docs:
nohup $(BROWSER) docs.html &
test:
echo $(DEPS)
.PHONY: all clean fclean re build_docs docs