-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
92 lines (77 loc) · 2.21 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
# Depricated. Use CMake instead.
#
# Definitions
#
# Directories
DirSrc = src
DirOut = out
DirData = data
DirTools = tools
# Tools
Lex = $(DirTools)\\flex.exe
Yacc = $(DirTools)\\bison.exe
# Output
ClientName = fql-client.exe
#
# Commands
#
all:
@make -s build
@make -s run
clear:
powershell clear
clean:
powershell mkdir $(DirOut) -Force | powershell Out-Null
powershell rm $(DirOut) -Force -Recurse
copy:
powershell cp $(DirSrc) $(DirOut) -Force -Recurse
gen:
$(Lex) -o $(DirOut)/Parsers/Rules/LexerSpecs.cpp $(DirSrc)/Parsers/Rules/LexerSpecs.l
$(Yacc) -d -o $(DirOut)/Parsers/Rules/ParserGrammar.cpp $(DirSrc)/Parsers/Rules/ParserGrammar.y
compile_parser:
@make -s gen
g++ -c $(DirOut)/Parsers/Rules/LexerSpecs.cpp -I $(DirOut) -o $(DirOut)/LexerSpecs.o
g++ -c $(DirOut)/Parsers/Rules/ParserGrammar.cpp -I $(DirOut) -o $(DirOut)/ParserGrammar.o
compile_client:
g++ -std=c++17 -I $(DirOut) -o $(DirOut)/$(ClientName) \
$(DirOut)/Client/Main.cpp \
\
$(DirOut)/Models/Table.cpp \
$(DirOut)/Models/TableColumn.cpp \
$(DirOut)/Models/TableRow.cpp \
\
$(DirOut)/Parsers/Tree/Clauses/GroupByNode.cpp \
$(DirOut)/Parsers/Tree/Clauses/HavingNode.cpp \
$(DirOut)/Parsers/Tree/Clauses/LimitNode.cpp \
$(DirOut)/Parsers/Tree/Clauses/OrderByNode.cpp \
$(DirOut)/Parsers/Tree/Clauses/WhereNode.cpp \
\
$(DirOut)/Parsers/Tree/Expressions/ColumnNode.cpp \
$(DirOut)/Parsers/Tree/Expressions/ExpressionNode.cpp \
$(DirOut)/Parsers/Tree/Expressions/FunctionNode.cpp \
$(DirOut)/Parsers/Tree/Expressions/OperatorNode.cpp \
\
$(DirOut)/Parsers/Tree/Statements/CreateNode.cpp \
$(DirOut)/Parsers/Tree/Statements/DeleteNode.cpp \
$(DirOut)/Parsers/Tree/Statements/DropNode.cpp \
$(DirOut)/Parsers/Tree/Statements/SelectNode.cpp \
$(DirOut)/Parsers/Tree/Statements/UpdateNode.cpp \
\
$(DirOut)/Parsers/Tree/DirectoryNode.cpp \
$(DirOut)/Parsers/Tree/SortRuleNode.cpp \
\
$(DirOut)/Parsers/Parser.cpp \
\
$(DirOut)/LexerSpecs.o \
$(DirOut)/ParserGrammar.o
compile_all:
@make -s compile_parser
@make -s compile_client
build:
@make -s clear
@make -s clean
@make -s copy
@make -s compile_all
run:
@make -s clear
$(DirOut)\\$(ClientName) < $(DirData)/input.txt