syndicate-rs/Makefile

80 lines
2.5 KiB
Makefile
Raw Normal View History

2021-08-13 16:40:31 +00:00
# Use cargo release to manage publication and versions etc.
#
# cargo install cargo-release
all:
cargo build --all-targets
test:
cargo test
test-all:
cargo test --all-targets
2022-10-26 11:41:46 +00:00
ws-bump:
cargo workspaces version \
--no-global-tag \
2023-01-08 12:19:06 +00:00
--individual-tag-prefix '%n-v' \
2022-10-26 11:41:46 +00:00
--allow-branch 'main'
2021-08-13 16:40:31 +00:00
2022-10-26 11:41:46 +00:00
ws-publish:
cargo workspaces publish \
--from-git
2023-02-08 13:35:15 +00:00
PROTOCOLS_BRANCH=main
pull-protocols:
git subtree pull -P syndicate/protocols \
-m 'Merge latest changes from the syndicate-protocols repository' \
git@git.syndicate-lang.org:syndicate-lang/syndicate-protocols \
2023-02-08 13:35:15 +00:00
$(PROTOCOLS_BRANCH)
static: static-x86_64
static-%:
cross build --target $*-unknown-linux-musl --features vendored-openssl
###########################################################################
# OK, rather than doing it myself (per
# https://eighty-twenty.org/2019/10/15/cross-compiling-rust), it turns
# out past a certain level of complexity we need more than just a
# linker but also a C compiler, compatible headers, and so forth. This
# proved nontrivial. The Rust team maintains a docker-based
# cross-compilation environment that's very easy to use, so instead,
# I'll just use that!
#
# cargo install cross
#
# The `vendored-openssl` thing is necessary because otherwise I'd have
# to mess about with getting a musl build of openssl, plus its headers
# etc, ready on my system despite being otherwise able to rely on
# cross. I think. It's a bit confusing.
2021-11-13 12:37:53 +00:00
x86_64-binary: x86_64-binary-release
x86_64-binary-release:
cross build --target x86_64-unknown-linux-musl --release --all-targets --features vendored-openssl
2022-01-09 20:00:20 +00:00
x86_64-binary-debug:
cross build --target x86_64-unknown-linux-musl --all-targets --features vendored-openssl
2021-11-14 14:57:12 +00:00
armv7-binary: armv7-binary-release
2021-11-14 14:57:12 +00:00
armv7-binary-release:
cross build --target=armv7-unknown-linux-musleabihf --release --all-targets --features vendored-openssl
2021-11-14 14:57:12 +00:00
armv7-binary-debug:
cross build --target=armv7-unknown-linux-musleabihf --all-targets --features vendored-openssl
# As of 2023-05-12 (and probably earlier!) this is no longer required with current Rust nightlies
# # Hack to workaround https://github.com/rust-embedded/cross/issues/598
# HACK_WORKAROUND_ISSUE_598=CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C link-arg=/usr/local/aarch64-linux-musl/lib/libc.a"
aarch64-binary: aarch64-binary-release
aarch64-binary-release:
cross build --target=aarch64-unknown-linux-musl --release --all-targets --features vendored-openssl
aarch64-binary-debug:
cross build --target=aarch64-unknown-linux-musl --all-targets --features vendored-openssl