-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
72 lines (61 loc) · 2.57 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
# A Makefile for building stuff during development. This is not used for the CI
# builds. These two are separate concepts with different constraints (which
# target is specified, cross compilation, etc.). Using this as a task runner (a
# la just).
DUCKDB_PLATFORM := osx_arm64
DUCKDB_EXTENSION_VERSION := v0.0.1
DUCKDB_API_VERSION := v0.0.1
ifeq ($(DUCKDB_PLATFORM),windows_amd64)
LIBRARY_OUTPUT := duckdb_protobuf.dll
endif
ifeq ($(DUCKDB_PLATFORM),osx_arm64)
LIBRARY_OUTPUT := libduckdb_protobuf.dylib
endif
ifeq ($(DUCKDB_PLATFORM),linux_amd64)
LIBRARY_OUTPUT := libduckdb_protobuf.so
endif
packages/vendor/duckdb:
mkdir -p packages/vendor/duckdb
curl -L https://crates.io/api/v1/crates/duckdb/1.0.0/download | tar --strip-components=1 -xz -C packages/vendor/duckdb
patch --strip=1 --directory=packages/vendor/duckdb < patches/duckdb+1.0.0.patch
packages/vendor/duckdb-loadable-macros:
mkdir -p packages/vendor/duckdb-loadable-macros
curl -L https://crates.io/api/v1/crates/duckdb-loadable-macros/0.1.2/download | tar --strip-components=1 -xz -C packages/vendor/duckdb-loadable-macros
patch --strip=1 --directory=packages/vendor/duckdb-loadable-macros < patches/duckdb-loadable-macros+0.1.2.patch
packages/vendor/libduckdb-sys:
mkdir -p packages/vendor/libduckdb-sys
curl -L https://crates.io/api/v1/crates/libduckdb-sys/1.0.0/download | tar --strip-components=1 -xz -C packages/vendor/libduckdb-sys
patch --strip=1 --directory=packages/vendor/libduckdb-sys < patches/libduckdb-sys+1.0.0.patch
vendor: packages/vendor/duckdb packages/vendor/duckdb-loadable-macros packages/vendor/libduckdb-sys
debug: vendor
cargo build --package duckdb_protobuf
cargo run \
--package duckdb_metadata_bin \
--bin duckdb_metadata \
-- \
--input target/debug/$(LIBRARY_OUTPUT) \
--output target/debug/protobuf.duckdb_extension \
--extension-version $(DUCKDB_EXTENSION_VERSION) \
--duckdb-api-version $(DUCKDB_API_VERSION) \
--platform $(DUCKDB_PLATFORM) \
--extension-abi-type C_STRUCT
release: vendor
cargo build --package duckdb_protobuf --release
cargo run \
--package duckdb_metadata_bin \
--bin duckdb_metadata \
-- \
--input target/release/$(LIBRARY_OUTPUT) \
--output target/release/protobuf.duckdb_extension \
--extension-version $(DUCKDB_EXTENSION_VERSION) \
--duckdb-api-version $(DUCKDB_API_VERSION) \
--platform $(DUCKDB_PLATFORM) \
--extension-abi-type C_STRUCT
test: release
cargo test --package duckdb_protobuf
install: release
duckdb \
-unsigned \
-cmd "FORCE INSTALL 'target/release/protobuf.duckdb_extension'" \
-no-stdin
.PHONY: test release debug vendor