-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
30 lines (26 loc) · 861 Bytes
/
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
# update the Cargo.lock every time the Cargo.toml changes.
Cargo.lock: Cargo.toml
cargo update --workspace
# Define targets and output directories
TARGETS = \
x86_64-pc-windows-gnu \
x86_64-apple-darwin \
aarch64-apple-darwin \
x86_64-unknown-linux-gnu \
aarch64-unknown-linux-gnu
LIBS_DIR = xdrjson/libs
BUILD_DIR = target
PROFILE = release-with-panic-unwind
# Build all libraries
build-libs: Cargo.lock
docker run --rm -v $$PWD:/wd -w /wd --platform=linux/amd64 rust:1.84.1-bullseye /bin/bash -c '\
rustc -vV > $(LIBS_DIR)/rust-version; \
for target in $(TARGETS); do \
cargo build --profile $(PROFILE) --target $$target; \
mkdir -p $(LIBS_DIR)/$$target; \
cp $(BUILD_DIR)/$$target/$(PROFILE)/*.a $(LIBS_DIR)/$$target/; \
done; \
shasum -a 256 $(LIBS_DIR)/**/*.a; \
'
dist-clean:
@rm -rf $(BUILD_DIR) $(LIBS_DIR)