-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
56 lines (42 loc) · 1.45 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
br:
echo "\033[35m Release compiled at: `TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"` \033[0m"
pwd && ls -al && cargo build --release
b:
echo "\033[35m Compiled at: `TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"` \033[0m"
pwd && ls -al && cargo build
d:
echo "\033[35m Document compiled at: `TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"` \033[0m"
cargo doc
f:
echo "\033[35m Code format at: `TZ=UTC-8 date +"%Y-%m-%d %H:%M:%S"` \033[0m"
cargo fmt
a:
make br && echo -n && make b && echo -n && make d
c:
rm -frv tests/upload/*.rs
cargo check
t:
cargo test -- --nocapture
tr:
cargo test --release -- --nocapture
clippy:
cargo clippy
# musl-gcc & musl-ldd
# apt install -y musl-tools && dpkg -L musl-tools
# env RUSTUP_DIST_SERVER=https://mirrors.sjtug.sjtu.edu.cn/rust-static rustup target add x86_64-unknown-linux-musl
musl:
rustup target add x86_64-unknown-linux-musl && cargo build --release --target x86_64-unknown-linux-musl
# docker run -v $PWD:/volume -v $CACHE:/volume/target -v $CACHE:/root/.cargo/registry --rm -t clux/muslrust cargo build --release
musld:
docker pull clux/muslrust && docker run -v `pwd`:/volume --rm -t clux/muslrust cargo build --release
# zypper install -y dpkg
# cargo install cargo-deb
deb:
cargo deb --target x86_64-unknown-linux-musl
# zypper install -y rpm-build
# apt install -y rpm
# cargo install cargo-rpm
# cargo rpm init
# but cargo-rpm-0.7.0 can't work with custom target-dir # ln -s $CACHE/cargo target
rpm:
cargo rpm build