-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
54 lines (40 loc) · 948 Bytes
/
Copy pathMakefile
File metadata and controls
54 lines (40 loc) · 948 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
45
46
47
48
49
50
51
52
53
54
CC = g++
CPP_VERSION = -std=c++17
CFLAGS = -Wall -Wextra -Werror $(CPP_VERSION)
NAME = expert_system
HEADER = expert_system.hpp \
fact.hpp \
grammar.hpp \
options.hpp \
parser.hpp \
rule.hpp \
utils.hpp
FILE = expert_system.cpp \
fact.cpp \
main.cpp \
options.cpp \
parser.cpp \
rule.cpp \
utils.cpp
BOOST_INC = -I ~/.brew/include
BOOST_LIB = -L ~/.brew/lib -l boost_program_options
SRC_DIR = src
INC_DIR = src
OBJ_DIR = obj
INC_FLAG = -I $(INC_DIR) $(BOOST_INC)
SRC = $(addprefix $(SRC_DIR)/,$(FILE))
INC = $(addprefix $(INC_DIR)/,$(HEADER))
OBJ = $(addprefix $(OBJ_DIR)/,$(FILE:%.cpp=%.o))
all: $(NAME)
$(NAME): $(OBJ_DIR) $(OBJ) $(INC)
$(CC) $(CFLAGS) $(INC_FLAG) -o $(NAME) $(OBJ) $(BOOST_LIB)
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
$(CC) $(CFLAGS) $(INC_FLAG) -c -o $@ $<
clean:
rm -rf $(OBJ_DIR)
fclean: clean
rm -f $(NAME)
re: fclean all
.PHONY: all clean fclean re