From 49ceec4782365b78f987545dca2f6da73956f2e9 Mon Sep 17 00:00:00 2001 From: Pedro Date: Mon, 10 Nov 2014 22:33:03 +0100 Subject: [PATCH] added deployment script --- src/Makefile | 14 +++++++------- src/deploy_to_hyrise.sh | 20 ++++++++++++++++++++ 2 files changed, 27 insertions(+), 7 deletions(-) create mode 100755 src/deploy_to_hyrise.sh diff --git a/src/Makefile b/src/Makefile index 95ee6ff..24b3cc2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,7 +1,7 @@ # Makefile -LIB_FILES = parser/bison_parser.cpp parser/flex_lexer.cpp parser/SQLParser.cpp lib/Expr.cpp lib/sqlhelper.cpp lib/destructors.cpp +SOURCES = $(shell find lib/ -name '*.cpp') parser/bison_parser.cpp parser/flex_lexer.cpp parser/SQLParser.cpp TESTS_MAIN = sql_tests.cpp TESTS_BIN = bin/tests @@ -19,16 +19,16 @@ build: clean cp parser/*.cpp build/ -analysis: $(LIB_FILES) sql_analysis.cpp - $(CC) $(CFLAGS) $(LIB_FILES) sql_analysis.cpp -o bin/analysis +analysis: $(SOURCES) sql_analysis.cpp + $(CC) $(CFLAGS) $(SOURCES) sql_analysis.cpp -o bin/analysis -grammar_test: $(LIB_FILES) sql_grammar_test.cpp - $(CC) $(CFLAGS) $(LIB_FILES) sql_grammar_test.cpp -o bin/grammar_test +grammar_test: $(SOURCES) sql_grammar_test.cpp + $(CC) $(CFLAGS) $(SOURCES) sql_grammar_test.cpp -o bin/grammar_test -tests: $(LIB_FILES) $(TESTS_MAIN) - $(CC) $(CFLAGS) $(LIB_FILES) $(TESTS_MAIN) -o $(TESTS_BIN) +tests: $(SOURCES) $(TESTS_MAIN) + $(CC) $(CFLAGS) $(SOURCES) $(TESTS_MAIN) -o $(TESTS_BIN) parser/bison_parser.cpp: diff --git a/src/deploy_to_hyrise.sh b/src/deploy_to_hyrise.sh new file mode 100755 index 0000000..deaddab --- /dev/null +++ b/src/deploy_to_hyrise.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Usage: deploy_to_hyrise.sh path/to/hyrise.git + +BUILD_PATH=$(readlink -f $(dirname $0))/build + +HYRISE_PATH=$1 + +SQL_PATH=${HYRISE_PATH}/src/lib/access/sql + +if [ ! -d $SQL_PATH ]; then + echo "Could not verify Hyrise path! ${HYRISE_PATH}" + exit +fi + + +make build + +rm ${SQL_PATH}/parser/* +cp ${BUILD_PATH}/* ${SQL_PATH}/parser/