-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (37 loc) · 1.05 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
NAME := ircserv
SRCDIR := srcs
INCDIR := inc
OBJDIR := objs
SRCS := $(shell find $(SRCDIR) -type f -name '*.cpp')
OBJS := $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SRCS))
DEPS := $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.d,$(SRCS))
CXX := c++
CXXFLAGS := -g -std=c++98 -Wall -Wextra -Werror -I$(INCDIR) -MMD
# ********************************************************************** #
all: $(NAME)
$(NAME): $(OBJS)
@$(CXX) $(CXXFLAGS) -o $(NAME) $^ $(LIBS) -I $(INCDIR)
@echo "\033[0;32m[✔️] $(NAME) successfully built.\033[0m"
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
@mkdir -p $(dir $@)
@echo Compiling $(shell echo "$<" | sed 's/$(SRCDIR)\///')
@$(CXX) $(CXXFLAGS) -c $< -o $@
-include $(DEPS)
# ********************************************************************** #
docker:
clear
docker kill ircserv || true
mkdir -p srcs/
mkdir -p inc/
mkdir -p objs/
sudo docker-compose build
sudo docker-compose up -d
sudo docker exec -it ircserv sh
clean:
rm -rf objs
rm -rf deps
fclean: clean
rm -f $(NAME)
re: fclean
@$(MAKE) all
.PHONY: all clean fclean re