Skip to content

Commit

Permalink
Add amalgamation sources
Browse files Browse the repository at this point in the history
  • Loading branch information
marcboeker committed Oct 6, 2023
1 parent 7741bf2 commit 80c7afa
Show file tree
Hide file tree
Showing 25 changed files with 408,243 additions and 409,116 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/deps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ on:
- master
paths:
- ".github/workflows/**"
- "duckdb.cpp"
- "duckdb.h"
- "duckdb.hpp"
- "lib/**"
jobs:
darwin_amd64:
runs-on: macos-latest
Expand Down
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
.DS_Store
run.sh
duckdb/
duckdb-src/
/lib
.idea
23 changes: 12 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ deps.source:

git clone -b v${DUCKDB_VERSION} --depth 1 https://github.com/duckdb/duckdb.git
cd duckdb/ && python3 scripts/amalgamation.py --extended --splits=10 && cd ..
mkdir -p duckdb-src

rm -rf lib
mkdir lib
cd duckdb/src/amalgamation && for f in *; do \
echo '#ifdef GODUCKDB_FROM_SOURCE' > ../../../duckdb-src/$$f; cat $$f >> ../../../duckdb-src/$$f; echo '\n#endif' >> ../../../duckdb-src/$$f; \
echo '#ifdef GODUCKDB_FROM_SOURCE' > ../../../lib/$$f; cat $$f >> ../../../lib/$$f; echo '\n#endif' >> ../../../lib/$$f; \
done

cp duckdb/src/include/duckdb.h duckdb.h
Expand All @@ -39,27 +40,27 @@ deps.source:
.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
cd duckdb-src && g++ -std=c++11 -O3 --target=x86_64-apple-macos11 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
ar rvs libduckdb.a duckdb-src/*.o
cd lib && g++ -std=c++11 -O3 --target=x86_64-apple-macos11 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
ar rvs libduckdb.a lib/*.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
cd duckdb-src && g++ -std=c++11 -O3 --target=arm64-apple-macos11 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
ar rvs libduckdb.a duckdb-src/*.o
cd lib && g++ -std=c++11 -O3 --target=arm64-apple-macos11 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
ar rvs libduckdb.a lib/*.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
cd duckdb-src && g++ -std=c++11 -O3 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
ar rvs libduckdb.a duckdb-src/*.o
if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "linux" ]; then echo "Error: must run build on linux"; false; fi
cd lib && g++ -std=c++11 -O3 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
ar rvs libduckdb.a lib/*.o
mv libduckdb.a deps/linux_amd64/libduckdb.a

.PHONY: deps.linux.arm64
deps.linux.arm64:
if [ "$(shell uname -s | tr '[:upper:]' '[:lower:]')" != "linux" ]; then echo "Error: must run build on linux"; false; fi
cd duckdb-src && aarch64-linux-gnu-g++ -std=c++11 -O3 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
aarch64-linux-gnu-gcc-ar rvs libduckdb.a duckdb-src/*.o
cd lib && aarch64-linux-gnu-g++ -std=c++11 -O3 -DGODUCKDB_FROM_SOURCE -DNDEBUG -c *.cpp || true
aarch64-linux-gnu-gcc-ar rvs libduckdb.a lib/*.o
mv libduckdb.a deps/linux_arm64/libduckdb.a
Loading

0 comments on commit 80c7afa

Please sign in to comment.