Skip to content

Commit 455a5bf

Browse files
committed
Rely on extension-ci-tools for Makefile
1 parent 33924e0 commit 455a5bf

File tree

2 files changed

+23
-38
lines changed

2 files changed

+23
-38
lines changed

Makefile

Lines changed: 16 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,25 @@
1-
.PHONY: all clean format debug release duckdb_debug duckdb_release pull update
1+
PROJ_DIR := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
22

33
all: release
44

5-
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
6-
PROJ_DIR := $(dir $(MKFILE_PATH))
7-
8-
EXTRA_CMAKE_VARIABLES :=
9-
10-
# These flags will make DuckDB build the extension
11-
EXTRA_CMAKE_VARIABLES += -DEXTENSION_STATIC_BUILD=1 -DBUILD_EXTENSIONS="tpch;json" ${OSX_ARCH_FLAG}
12-
EXTRA_CMAKE_VARIABLES += -DDUCKDB_EXTENSION_NAMES="substrait"
13-
EXTRA_CMAKE_VARIABLES += -DDUCKDB_EXTENSION_SUBSTRAIT_SHOULD_LINK=1
14-
EXTRA_CMAKE_VARIABLES += -DDUCKDB_EXTENSION_SUBSTRAIT_LOAD_TESTS=1
15-
EXTRA_CMAKE_VARIABLES += -DDUCKDB_EXTENSION_SUBSTRAIT_PATH=$(PROJ_DIR)
16-
EXTRA_CMAKE_VARIABLES += -DDUCKDB_EXTENSION_SUBSTRAIT_TEST_PATH=$(PROJ_DIR)test
17-
EXTRA_CMAKE_VARIABLES += -DDUCKDB_EXTENSION_SUBSTRAIT_INCLUDE_PATH="$(PROJ_DIR)src/include"
18-
export
19-
20-
DUCKDB_DIRECTORY=
21-
ifndef DUCKDB_DIR
22-
DUCKDB_DIRECTORY=./duckdb
23-
else
24-
DUCKDB_DIRECTORY=${DUCKDB_DIR}
5+
# Configuration of extension
6+
EXT_NAME=substrait
7+
EXT_CONFIG=${PROJ_DIR}extension_config.cmake
8+
9+
CORE_EXTENSIONS='tpch;json'
10+
11+
# Set this flag during building to enable the benchmark runner
12+
ifeq (${BUILD_BENCHMARK}, 1)
13+
TOOLCHAIN_FLAGS:=${TOOLCHAIN_FLAGS} -DBUILD_BENCHMARKS=1
2514
endif
2615

16+
# Include the Makefile from extension-ci-tools
17+
include extension-ci-tools/makefiles/duckdb_extension.Makefile
18+
2719
pull:
2820
git submodule init
2921
git submodule update --recursive --remote
3022

31-
clean:
32-
rm -rf ${DUCKDB_DIRECTORY}/build
33-
rm -rf testext
34-
cd ${DUCKDB_DIRECTORY} && make clean
35-
36-
# Main builds
37-
debug:
38-
# Have to actually cd here because the makefile assumes it's called from within duckdb
39-
cd ${DUCKDB_DIRECTORY} && $(MAKE) -C . debug
40-
41-
release:
42-
# Have to actually cd here because the makefile assumes it's called from within duckdb
43-
cd ${DUCKDB_DIRECTORY} && $(MAKE) -C . release
44-
4523
# Client builds
4624
%_js: export BUILD_NODE=1
4725
debug_js: debug
@@ -62,10 +40,10 @@ release_python: release
6240
test: test_release
6341

6442
test_release: release
65-
${DUCKDB_DIRECTORY}/build/release/test/unittest "$(PROJ_DIR)test/*"
43+
build/release/test/unittest "$(PROJ_DIR)test/*"
6644

6745
test_debug: debug
68-
${DUCKDB_DIRECTORY}/build/debug/test/unittest "$(PROJ_DIR)test/*"
46+
build/debug/test/unittest "$(PROJ_DIR)test/*"
6947

7048
# Client tests
7149
test_python: test_debug_python
@@ -88,4 +66,4 @@ format:
8866
rm .clang-format
8967

9068
update:
91-
git submodule update --remote --merge
69+
git submodule update --remote --merge

extension_config.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file is included by DuckDB's build system. It specifies which extension to load
2+
3+
# Extension from this repo
4+
duckdb_extension_load(substrait
5+
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}
6+
INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/src/include
7+
)

0 commit comments

Comments
 (0)