Add scripts to build for x86_64 linux too

This commit is contained in:
Igor Katson 2021-10-17 18:17:50 +01:00
parent 60b7d4a531
commit 27145c758c
5 changed files with 138 additions and 11 deletions

View file

@ -18,16 +18,42 @@ install: build-release
$(MAKE) sign-release
install target/release/rqbit "$(HOME)/bin/"
@PHONY: release-all
release-all:
@PHONY: release-macos-universal
release-macos-universal:
cargo build --target aarch64-apple-darwin --release
cargo build --target x86_64-apple-darwin --release
# brew install mingw-w64 for this to work
lipo \
./target/aarch64-apple-darwin/release/rqbit \
./target/x86_64-apple-darwin/release/rqbit \
-create \
-output ./target/x86_64-apple-darwin/release/rqbit-osx-universal
@PHONY: release-windows
release-windows:
# prereqs:
# brew install mingw-w64
cargo build --target x86_64-pc-windows-gnu --release
@PHONY: release-linux
release-linux:
# prereqs:
# brew tap messense/macos-cross-toolchains
# brew install x86_64-unknown-linux-gnu
# features are so that we don't need to cross-compile openssl
export CC_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-gcc && \
export CXX_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-g++ && \
export AR_x86_64_unknown_linux_gnu=x86_64-unknown-linux-gnu-ar && \
export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-unknown-linux-gnu-gcc && \
cargo build --release --target=x86_64-unknown-linux-gnu --no-default-features \
--features=sha1-rust,rust-tls
@PHONY: release-all
release-all: release-windows release-linux release-macos-universal
rm -rf /tmp/rqbit-release
mkdir -p /tmp/rqbit-release
lipo ./target/aarch64-apple-darwin/release/rqbit ./target/x86_64-apple-darwin/release/rqbit -create -output /tmp/rqbit-release/rqbit-osx-universal
cp ./target/x86_64-pc-windows-gnu/release/rqbit.exe /tmp/rqbit-release
cp ./target/x86_64-apple-darwin/release/rqbit-osx-universal /tmp/rqbit-release
cp ./target/x86_64-unknown-linux-gnu/release/rqbit /tmp/rqbit-release/rqbit-linux-x86_64
echo "The release was built in /tmp/rqbit-release"