forked from HowwAbout/Cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
44 lines (33 loc) · 889 Bytes
/
Makefile
File metadata and controls
44 lines (33 loc) · 889 Bytes
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
# Project name
NAME = mybot
# Directories
SRC_DIR = srcs
INC_DIR = include
OUT_DIR = build
BIN_DIR = bin
LIB_DIR = libs/json/include
# Source files by directory
SRC_FILES = bot jenkins_utils dpp_utils config main
# Compile and Linker Flags
CXX = clang++
CXXFLAGS = -std=c++17 -g3 -I$(INC_DIR) -I$(LIB_DIR) -I/opt/homebrew/include -I/opt/homebrew/opt/llvm/include
LDFLAGS = -L/opt/homebrew/lib -ldpp -lcurl
# Source and Object files
SRCS = $(addprefix $(SRC_DIR)/, $(addsuffix .cpp, $(SRC_FILES)))
OBJS = $(SRCS:$(SRC_DIR)/%.cpp=$(OUT_DIR)/%.o)
# Rules
all: $(NAME)
clean:
$(RM) -r $(OUT_DIR)
fclean: clean
$(RM) -r $(BIN_DIR)
$(RM) $(NAME)
re: fclean all
.PHONY: all clean fclean re
# Build rules
$(NAME): $(OBJS)
@mkdir -p $(BIN_DIR)
$(CXX) $(OBJS) $(LDFLAGS) -o $(BIN_DIR)/$(NAME)
$(OBJS): $(OUT_DIR)/%.o: $(SRC_DIR)/%.cpp
@mkdir -p $(@D)
$(CXX) $(CXXFLAGS) -c $< -o $@