-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
46 lines (33 loc) · 1.42 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
CXX = g++
CXXFLAGS = -Wno-deprecated-register -O0 -g -Wall -std=c++14 #-DDBSCANDEBUG
PARSEROBJ = parser/parser.o parser/lexer.o parser/query.o
OPERATOROBJ = operators/datasource.o operators/join.o
PLANNEROBJ = planner/constructor.o planner/catalog.o
UTILOBJ = util/config.o
all: parsertestexe plannertestexe testexe catalogtestexe
%.o: %.cc
$(CXX) $(CXXFLAGS) -c -o $@ $*.cc
parser/query.o: parser/parser.o
parser/parser.o: parser/dbparser.yy
cd parser; bison -Werror=conflicts-sr -d -v -t dbparser.yy
patch parser/dbparser.tab.hh parser/patch
$(CXX) $(CXXFLAGS) -c -o $@ parser/dbparser.tab.cc
parser/lexer.o: parser/dblexer.l parser/parser.o
flex --outfile=parser/dblexer.yy.cc $<
$(CXX) $(CXXFLAGS) -c -o $@ parser/dblexer.yy.cc
testexe: main.cc $(PARSEROBJ) $(OPERATOROBJ) $(PLANNEROBJ) $(UTILOBJ)
$(CXX) $(CXXFLAGS) -o $@ $^
parsertestexe: parser/parsertest.cc $(PARSEROBJ)
$(CXX) $(CXXFLAGS) -o $@ $^
plannertestexe: planner/test.cc $(PARSEROBJ) $(OPERATOROBJ) $(PLANNEROBJ) $(UTILOBJ)
$(CXX) $(CXXFLAGS) -o $@ $^ -lreadline
catalogtestexe: planner/catalog_test.cc planner/catalog.o
$(CXX) $(CXXFLAGS) -o $@ $^
clean:
rm -f parsertestexe plannertestexe testexe catalogtestexe
rm -f $(PARSEROBJ) $(OPERATOROBJ) $(PLANNEROBJ)
rm -f $(addprefix parser/, dblexer.yy.cc dbparser.tab.cc dbparser.tab.hh \
stack.hh location.hh position.hh dbparser.output)
test: testexe
cd tests; ./run_all.sh
.PHONY: all clean test