diff --git a/parquet/Makefile b/parquet/Makefile new file mode 100644 index 0000000..4c074dd --- /dev/null +++ b/parquet/Makefile @@ -0,0 +1,30 @@ +PARQUET_CPP=~/src/parquet-cpp + +CC = g++ +# odd, no -lz -ldl -lpthread needed? +CFLAGS = -I ../sqlite -O3 -std=c++11 -Wall -fPIC -g +PARQUET_LIB = $(PARQUET_CPP)/build/release/libparquet.a +THRIFT_LIB = $(PARQUET_CPP)/thrift_ep/src/thrift_ep-install/lib/libthrift.a +ARROW_LIB = $(PARQUET_CPP)/build/release/libarrow.so +BOOST_LIB = /usr/lib/x86_64-linux-gnu/libboost_regex.so + +LDFLAGS = -O3 $(PARQUET_LIB) $(THRIFT_LIB) $(ARROW_LIB) $(BOOST_LIB) +DEPS = hellomake.h +OBJ = parquet.o parquet_table.o parquet_cursor.o + +libparquet.so: $(OBJ) + $(CC) -shared -o $@ $^ $(LDFLAGS) + +parquet_cursor.o: parquet_cursor.cc parquet_cursor.h parquet_table.h + $(CC) -c -o $@ $< $(CFLAGS) + +parquet_table.o: parquet_table.cc parquet_table.h + $(CC) -c -o $@ $< $(CFLAGS) + +parquet.o: parquet.cc parquet_cursor.h parquet_table.h + $(CC) -c -o $@ $< $(CFLAGS) + +.PHONY: clean + +clean: + rm -f *.o *.so diff --git a/parquet/go b/parquet/go index c033fde..2891431 100755 --- a/parquet/go +++ b/parquet/go @@ -1,7 +1,7 @@ #!/bin/bash set -euo pipefail -./make +make if [ ! -v DEBUG ]; then diff --git a/parquet/make b/parquet/make deleted file mode 100755 index 2abb735..0000000 --- a/parquet/make +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -set -euo pipefail -#set -x - -PARQUET_CPP=${PARQUET_CPP:-~/src/parquet-cpp} - -# make obj file -clean() { - rm -f *.o *.so -} - -build() { - clean - # -O3 -s -DNDEBUG - g++ -O3 -std=c++11 -Wall -fPIC -c -g *.cc -I ../sqlite -lz -ldl -lpthread - - g++ -O3 -shared -o libparquet.so *.o \ - ${PARQUET_CPP}/build/release/libparquet.a \ - ${PARQUET_CPP}/thrift_ep/src/thrift_ep-install/lib/libthrift.a \ - ${PARQUET_CPP}/build/release/libarrow.so \ - /usr/lib/x86_64-linux-gnu/libboost_regex.so -} - -fn=${1:-build} - -"$fn"