-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (43 loc) · 1.58 KB
/
Copy pathMakefile
File metadata and controls
51 lines (43 loc) · 1.58 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
.PHONY: linux windows arm android-arm64 clean test cross-check
CROSS := $(shell command -v cross 2>/dev/null)
linux:
cargo build --release
@echo "Done: target/release/blunderchess"
windows: cross-check
@if docker ps >/dev/null 2>&1; then \
cross build --release --target x86_64-pc-windows-gnu; \
elif sg docker -c 'true' 2>/dev/null; then \
sg docker -c 'cross build --release --target x86_64-pc-windows-gnu'; \
else \
echo "ERROR: Cannot access Docker. Run: newgrp docker"; exit 1; \
fi
@echo "Done: target/x86_64-pc-windows-gnu/release/blunderchess.exe"
arm: cross-check
@if docker ps >/dev/null 2>&1; then \
cross build --release --target aarch64-unknown-linux-gnu; \
elif sg docker -c 'true' 2>/dev/null; then \
sg docker -c 'cross build --release --target aarch64-unknown-linux-gnu'; \
else \
echo "ERROR: Cannot access Docker. Run: newgrp docker"; exit 1; \
fi
@echo "Done: target/aarch64-unknown-linux-gnu/release/blunderchess"
android-arm64: cross-check
@if docker ps >/dev/null 2>&1; then \
cross build --release --target aarch64-linux-android; \
elif sg docker -c 'true' 2>/dev/null; then \
sg docker -c 'cross build --release --target aarch64-linux-android'; \
else \
echo "ERROR: Cannot access Docker. Run: newgrp docker"; exit 1; \
fi
@echo "Done: target/aarch64-linux-android/release/blunderchess"
cross-check:
@if [ -z "$(CROSS)" ]; then \
echo "ERROR: 'cross' not found."; \
echo "Install with: cargo install cross"; \
echo "Requires Docker: sudo apt install docker.io"; \
exit 1; \
fi
clean:
cargo clean
test:
cargo test --lib --test benchmarks