forked from cwida/duckpgq-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
114 lines (85 loc) · 3.53 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
.PHONY: all clean format debug release duckdb_debug duckdb_release pull update
all: release
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
PROJ_DIR := $(dir $(MKFILE_PATH))
OSX_BUILD_UNIVERSAL_FLAG=
ifeq (${OSX_BUILD_UNIVERSAL}, 1)
OSX_BUILD_UNIVERSAL_FLAG=-DOSX_BUILD_UNIVERSAL=1
endif
ifeq (${STATIC_LIBCPP}, 1)
STATIC_LIBCPP=-DSTATIC_LIBCPP=TRUE
endif
ifeq ($(GEN),ninja)
GENERATOR=-G "Ninja"
FORCE_COLOR=-DFORCE_COLORED_OUTPUT=1
endif
ifndef ($(DUCKDB_VERSION))
DUCKDB_VERSION_FLAG=$(DUCKDB_VERSION)
endif
BUILD_FLAGS=-DEXTENSION_STATIC_BUILD=1 -DBUILD_TPCH_EXTENSION=1 -DBUILD_PARQUET_EXTENSION=1 ${OSX_BUILD_UNIVERSAL_FLAG} ${STATIC_LIBCPP}
CLIENT_FLAGS :=
# These flags will make DuckDB build the extension
EXTENSION_FLAGS=-DDUCKDB_OOT_EXTENSION_NAMES="duckpgq" -DDUCKDB_OOT_EXTENSION_DUCKPGQ_PATH="$(PROJ_DIR)" -DDUCKDB_OOT_EXTENSION_DUCKPGQ_SHOULD_LINK="TRUE" -DDUCKDB_OOT_EXTENSION_DUCKPGQ_INCLUDE_PATH="$(PROJ_DIR)duckpgq/include"
pull:
git submodule init
git submodule update --recursive --remote
clean:
rm -rf build
rm -rf testext
cd duckdb-pgq && make clean
# Main build
debug:
mkdir -p build/debug && \
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} -DCMAKE_BUILD_TYPE=Debug ${BUILD_FLAGS} -S ./duckdb-pgq/ -B build/debug && \
cmake --build build/debug --config Debug
release:
mkdir -p build/release && \
cmake $(GENERATOR) $(FORCE_COLOR) $(EXTENSION_FLAGS) ${CLIENT_FLAGS} -DCMAKE_BUILD_TYPE=Release ${BUILD_FLAGS} -S ./duckdb-pgq/ -B build/release && \
cmake --build build/release --config Release
# Client build
debug_js: CLIENT_FLAGS=-DBUILD_NODE=1 -DBUILD_JSON_EXTENSION=1
debug_js: debug
debug_r: CLIENT_FLAGS=-DBUILD_R=1
debug_r: debug
debug_python: CLIENT_FLAGS=-DBUILD_PYTHON=1 -DBUILD_JSON_EXTENSION=1 -DBUILD_FTS_EXTENSION=1 -DBUILD_TPCH_EXTENSION=1 -DBUILD_VISUALIZER_EXTENSION=1 -DBUILD_TPCDS_EXTENSION=1
debug_python: debug
release_js: CLIENT_FLAGS=-DBUILD_NODE=1 -DBUILD_JSON_EXTENSION=1
release_js: release
release_r: CLIENT_FLAGS=-DBUILD_R=1
release_r: release
release_python: CLIENT_FLAGS=-DBUILD_PYTHON=1 -DBUILD_JSON_EXTENSION=1 -DBUILD_FTS_EXTENSION=1 -DBUILD_TPCH_EXTENSION=1 -DBUILD_VISUALIZER_EXTENSION=1 -DBUILD_TPCDS_EXTENSION=1
release_python: release
# Main tests
test: test_release
test_release: release
./build/release/test/unittest --test-dir . "[sql]"
test_debug: debug
./build/debug/test/unittest --test-dir . "[sql]"
# Client tests
test_js: test_debug_js
test_debug_js: debug_js
cd duckdb-pgq/tools/nodejs && npm run test-path -- "../../../test/nodejs/**/*.js"
test_release_js: release_js
cd duckdb-pgq/tools/nodejs && npm run test-path -- "../../../test/nodejs/**/*.js"
test_python: test_debug_python
test_debug_python: debug_python
cd test/python && python3 -m pytest
test_release_python: release_python
cd test/python && python3 -m pytest
format:
find duckpgq/ -iname *.hpp -o -iname *.cpp | xargs clang-format --sort-includes=0 -style=file -i
cmake-format -i CMakeLists.txt
update:
git submodule update --remote --merge
test_release_stock_duckdb:
rm -rf duckdb
git clone -b $(DUCKDB_VERSION_FLAG) --single-branch --depth 1 https://github.com/duckdb/duckdb.git
cd duckdb; make release;
python3 scripts/copy_tests.py --mode release
cd duckdb; ./build/release/test/unittest "test/extension/duckpgq/*"
test_debug_stock_duckdb:
rm -rf duckdb
git clone -b $(DUCKDB_VERSION_FLAG) --single-branch --depth 1 https://github.com/duckdb/duckdb.git
cd duckdb; make debug;
python3 scripts/copy_tests.py --mode debug
cd duckdb; ./build/debug/test/unittest "test/extension/duckpgq/*"