forked from marcboeker/go-duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (35 loc) · 1.58 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
DUCKDB_VERSION=0.7.0
.PHONY: install
install:
go install .
.PHONY: examples
examples:
go run examples/simple.go
.PHONY: test
test:
go test -v -race -count=1 .
.PHONY: deps.source
deps.source:
curl -Lo libduckdb.zip https://github.com/duckdb/duckdb/releases/download/v${DUCKDB_VERSION}/libduckdb-src.zip
unzip -o libduckdb.zip
rm libduckdb.zip
echo '#ifdef GODUCKDB_FROM_SOURCE' > duckdb.hpp.tmp; cat duckdb.hpp >> duckdb.hpp.tmp; echo '\n#endif' >> duckdb.hpp.tmp; mv duckdb.hpp.tmp duckdb.hpp
echo '#ifdef GODUCKDB_FROM_SOURCE' > duckdb.cpp.tmp; cat duckdb.cpp >> duckdb.cpp.tmp; echo '\n#endif' >> duckdb.cpp.tmp; mv duckdb.cpp.tmp duckdb.cpp
.PHONY: deps.darwin.amd64
deps.darwin.amd64:
if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "darwin" ]; then echo "Error: must run build on darwin"; false; fi
g++ -std=c++11 -O3 --target=x86_64-apple-macos11 -DGODUCKDB_FROM_SOURCE -c duckdb.cpp
ar rvs libduckdb.a duckdb.o
mv libduckdb.a deps/darwin_amd64/libduckdb.a
.PHONY: deps.darwin.arm64
deps.darwin.arm64:
if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "darwin" ]; then echo "Error: must run build on darwin"; false; fi
g++ -std=c++11 -O3 --target=arm64-apple-macos11 -DGODUCKDB_FROM_SOURCE -c duckdb.cpp
ar rvs libduckdb.a duckdb.o
mv libduckdb.a deps/darwin_arm64/libduckdb.a
.PHONY: deps.linux.amd64
deps.linux.amd64:
if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "linux" ]; then echo "Error: must run build on linux"; false; fi
g++ -std=c++11 -O3 -DGODUCKDB_FROM_SOURCE -c duckdb.cpp
ar rvs libduckdb.a duckdb.o
mv libduckdb.a deps/linux_amd64/libduckdb.a