-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
78 lines (62 loc) · 1.81 KB
/
Makefile
File metadata and controls
78 lines (62 loc) · 1.81 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Detect OS
ifeq ($(OS),Windows_NT)
DETECTED_OS := Windows
else
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
DETECTED_OS := Linux
endif
ifeq ($(UNAME_S),Darwin)
DETECTED_OS := Darwin
endif
endif
all: check test fmt clippy debug release
check:
cargo check
debug:
cargo build
release:
cargo build --release
# The "smart" static target that works on any OS
release-static:
ifeq ($(DETECTED_OS),Windows)
$(MAKE) release-windows
else ifeq ($(DETECTED_OS),Darwin)
$(MAKE) release-mac
else
$(MAKE) release-linux-static
endif
release-linux-static:
rustup target add x86_64-unknown-linux-musl
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="-C target-feature=+crt-static" \
cargo build --release --target x86_64-unknown-linux-musl -p mapache
release-arm64:
rustup target add aarch64-unknown-linux-musl
cargo build --release --target aarch64-unknown-linux-musl -p mapache
release-armv7:
rustup target add armv7-unknown-linux-musleabihf
cargo build --release --target armv7-unknown-linux-musleabihf -p mapache
release-windows:
rustup target add x86_64-pc-windows-msvc
RUSTFLAGS="-C target-feature=+crt-static" \
cargo xwin build --release --target x86_64-pc-windows-msvc -p mapache
release-mac:
rustup target add x86_64-apple-darwin aarch64-apple-darwin
cargo build --release --target x86_64-apple-darwin -p mapache --no-default-features
cargo build --release --target aarch64-apple-darwin -p mapache --no-default-features
test:
cargo test -r
doc:
cargo doc --no-deps --document-private-items
fmt:
cargo fmt --all
clippy:
cargo clippy --all-targets --all-features -- -D warnings
cov:
env MAPACHE_TEST_QUIET=false \
cargo llvm-cov --workspace --html --quiet \
< /dev/null 2> /dev/null
xdg-open ./target/llvm-cov/html/index.html
clean:
cargo clean
rm -rf ./build/