-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
69 lines (45 loc) · 1.31 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
SOURCES = $(shell find src/ -name "*.cpp")
OBJECTS = $(patsubst %.cpp,%.o,$(SOURCES))
#DEPENDS = ${OBJECTS:.o=.d}
CXX = g++
CXX_FLAGS = -g -std=c++17 -MMD
EXEC = loodb
SQLITE_DIR = sqlite
SQLITE_BIN = sqlite3
PARSER_DIR = src/interpreter/parser
QUERY_DIR = queries
-include ${DEPENDS}
.PHONY: build clean test
## Application build/utility commands
##########################################################
build: bison flex replace ${EXEC} clean
clean:
@rm ${OBJECTS}
run:
@./${EXEC}
debug:
@gdb ./${EXEC}
dry-run:
@echo ${SRC_DIR}
@echo ${SOURCES}
@echo ${OBJECTS}
${EXEC}: ${OBJECTS}
@${CXX} ${CXX_FLAGS} ${OBJECTS} ${PARSER_DIR}/sqloo.tab.cc ${PARSER_DIR}/lex.yy.c -o ${EXEC}
## Parser related build/utility commands
##########################################################
bison:
cd ${PARSER_DIR} && bison sqloo.yy
flex:
cd ${PARSER_DIR} && flex sqloo.l
replace:
cd ${PARSER_DIR} && sed -i 's/return \*new (yyas_<T> ()) T (t)/return \*new (yyas_<T> ()) T (std\:\:move((T\&)t))/g' sqloo.tab.hh
## The "sql" set of commands deal with the official SQLite3 database
##########################################################
sql:
${SQLITE_DIR}/${SQLITE_BIN}
sql-build:
./sqlite.sh ${SQLITE_DIR} ${SQLITE_BIN}
sql-rm:
rm -rf ${SQLITE_DIR}
sql-gen:
./sqlgen.sh ${SQLITE_DIR}/${SQLITE_BIN} ${QUERY_DIR}