diff --git a/Makefile b/Makefile index 2306ba7..8affd2a 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,40 @@ build: build-headers build-rust build-java # artifacts are set properly. build-rust: build-rust-$(build_arch)-$(build_os) +# Compile the Rust part. +build-rust-all-targets: build-rust-amd64-darwin build-rust-arm64-darwin build-rust-amd64-linux build-rust-amd64-windows + +build-rust-amd64-darwin: + rustup target add x86_64-apple-darwin + cargo build --release --target=x86_64-apple-darwin + mkdir -p artifacts/darwin-amd64 + cp target/x86_64-apple-darwin/release/libwasmer_jni.dylib artifacts/darwin-amd64 + install_name_tool -id "@rpath/libwasmer_jni.dylib" ./artifacts/darwin-amd64/libwasmer_jni.dylib + test -h target/current || ln -s x86_64-apple-darwin/release target/current + +build-rust-arm64-darwin: + rustup target add aarch64-apple-darwin + cargo build --release --target=aarch64-apple-darwin + mkdir -p artifacts/darwin-arm64 + cp target/aarch64-apple-darwin/release/libwasmer_jni.dylib artifacts/darwin-arm64 + install_name_tool -id "@rpath/libwasmer_jni.dylib" ./artifacts/darwin-arm64/libwasmer_jni.dylib + test -h target/current || ln -s aarch64-apple-darwin/release target/current + +build-rust-amd64-linux: + rustup target add x86_64-unknown-linux-gnu + cargo build --release --target=x86_64-unknown-linux-gnu + mkdir -p artifacts/linux-amd64 + cp target/x86_64-unknown-linux-gnu/release/libwasmer_jni.so artifacts/linux-amd64/ + test -h target/current || ln -s x86_64-unknown-linux-gnu/release target/current + +build-rust-amd64-windows: + rustup target add x86_64-pc-windows-msvc + cargo build --release --target=x86_64-pc-windows-msvc + mkdir -p artifacts/windows-amd64 + cp target/x86_64-pc-windows-msvc/release/wasmer_jni.dll artifacts/windows-amd64/ + mkdir -p target/current + cp target/x86_64-pc-windows-msvc/release/wasmer_jni.dll target/current/ + # Compile the Java part (incl. `build-test`, see `gradlew`). build-java: "./gradlew" --info build