moved bison related files into subdirectory bison
This commit is contained in:
parent
ce45347561
commit
b97ae3545f
18
src/Makefile
18
src/Makefile
|
@ -1,8 +1,11 @@
|
|||
# Makefile
|
||||
|
||||
LIB_FILES = flex_lexer.c bison_parser.c lib/Statement.cpp lib/Expr.cpp lib/SQLParser.cpp
|
||||
# define which parser to use. Either bison or lemon
|
||||
PARSER = bison
|
||||
|
||||
|
||||
LIB_FILES = $(PARSER)/$(PARSER)_parser.c $(PARSER)/flex_lexer.c $(PARSER)/SQLParser.cpp lib/Statement.cpp lib/Expr.cpp
|
||||
|
||||
TESTS_MAIN = sql_tests.cpp
|
||||
TESTS_BIN = bin/tests
|
||||
|
||||
|
@ -10,7 +13,7 @@ EXECUTION_MAIN = sql_execution.cpp
|
|||
EXECUTION_BIN = bin/sql_execution
|
||||
|
||||
CC = g++
|
||||
CFLAGS = -g -O3 -Ilib/ -I./
|
||||
CFLAGS = -g -O3 -Ilib/ -I./ -Ibison/
|
||||
|
||||
|
||||
tests: $(LIB_FILES) $(TESTS_MAIN)
|
||||
|
@ -21,13 +24,10 @@ execution: $(LIB_FILES) $(EXECUTION_MAIN)
|
|||
$(CC) $(CFLAGS) $(LIB_FILES) $(EXECUTION_MAIN) -o $(EXECUTION_BIN)
|
||||
|
||||
|
||||
flex_lexer.c: flex_lexer.l
|
||||
flex flex_lexer.l
|
||||
|
||||
|
||||
bison_parser.c: bison_parser.y flex_lexer.c
|
||||
bison bison_parser.y
|
||||
bison/bison_parser.c:
|
||||
make -C bison/
|
||||
|
||||
|
||||
clean:
|
||||
rm -f *.o *~ flex_lexer.c flex_lexer.h bison_parser.c bison_parser.h $(EXECUTION_BIN) $(TESTS_BIN)
|
||||
rm -f *.o *~ $(EXECUTION_BIN) $(TESTS_BIN)
|
||||
make clean -C bison/
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
all: bison_parser.c flex_lexer.c
|
||||
|
||||
bison_parser.c: bison_parser.y
|
||||
bison bison_parser.y
|
||||
|
||||
flex_lexer.c: flex_lexer.l
|
||||
flex flex_lexer.l
|
||||
|
||||
clean:
|
||||
rm -f bison_parser.c flex_lexer.c bison_parser.h flex_lexer.h
|
|
@ -2,7 +2,7 @@
|
|||
* sql_tests.cpp
|
||||
*/
|
||||
|
||||
#include "lib/SQLParser.h"
|
||||
#include "SQLParser.h"
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <cassert>
|
||||
|
|
Loading…
Reference in New Issue