moved bison related files into subdirectory bison

This commit is contained in:
Pedro 2014-10-16 15:54:51 +02:00
parent ce45347561
commit b97ae3545f
7 changed files with 21 additions and 10 deletions

View File

@ -1,8 +1,11 @@
# Makefile # 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_MAIN = sql_tests.cpp
TESTS_BIN = bin/tests TESTS_BIN = bin/tests
@ -10,7 +13,7 @@ EXECUTION_MAIN = sql_execution.cpp
EXECUTION_BIN = bin/sql_execution EXECUTION_BIN = bin/sql_execution
CC = g++ CC = g++
CFLAGS = -g -O3 -Ilib/ -I./ CFLAGS = -g -O3 -Ilib/ -I./ -Ibison/
tests: $(LIB_FILES) $(TESTS_MAIN) tests: $(LIB_FILES) $(TESTS_MAIN)
@ -21,13 +24,10 @@ execution: $(LIB_FILES) $(EXECUTION_MAIN)
$(CC) $(CFLAGS) $(LIB_FILES) $(EXECUTION_MAIN) -o $(EXECUTION_BIN) $(CC) $(CFLAGS) $(LIB_FILES) $(EXECUTION_MAIN) -o $(EXECUTION_BIN)
flex_lexer.c: flex_lexer.l bison/bison_parser.c:
flex flex_lexer.l make -C bison/
bison_parser.c: bison_parser.y flex_lexer.c
bison bison_parser.y
clean: 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/

11
src/bison/Makefile Normal file
View File

@ -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

View File

@ -2,7 +2,7 @@
* sql_tests.cpp * sql_tests.cpp
*/ */
#include "lib/SQLParser.h" #include "SQLParser.h"
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
#include <cassert> #include <cassert>