forked from driftluo/tentacle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
62 lines (44 loc) · 2.22 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
55
56
57
58
59
60
61
62
MOLC := moleculec
MOLC_VERSION := 0.7.0
MOL_FILES := \
tentacle/src/protocol_select/protocol_select.mol \
secio/src/handshake/handshake.mol \
MOL_RUST_FILES := $(patsubst %.mol,%_mol.rs,${MOL_FILES})
Change_Work_Path := cd tentacle
fmt:
cargo fmt --all -- --check
clippy:
$(Change_Work_Path) && RUSTFLAGS='-W warnings' cargo clippy --all --tests --features ws,unstable,tls -- -D clippy::let_underscore_must_use
test:
$(Change_Work_Path) && RUSTFLAGS='-W warnings' RUST_BACKTRACE=full cargo test --all --features ws,unstable,tls
fuzz:
cargo +nightly fuzz run secio_crypto_decrypt_cipher -- -max_total_time=60
cargo +nightly fuzz run secio_crypto_encrypt_cipher -- -max_total_time=60
cargo +nightly fuzz run yamux_frame_codec -- -max_total_time=60
build:
$(Change_Work_Path) && RUSTFLAGS='-W warnings' cargo build --all --features ws
$(Change_Work_Path) && RUSTFLAGS='-W warnings' cargo build --all --features tls
$(Change_Work_Path) && RUSTFLAGS='-W warnings' cargo build --all --features ws,unstable
examples:
$(Change_Work_Path) && cargo build --examples --all --features unstable
features-check:
$(Change_Work_Path) && cargo build --features tls
$(Change_Work_Path) && cargo build --features parking_lot
$(Change_Work_Path) && cargo build --features unstable
$(Change_Work_Path) && cargo build --features tokio-runtime,generic-timer,unstable --no-default-features
$(Change_Work_Path) && cargo build --features async-runtime,generic-timer,unstable --no-default-features
$(Change_Work_Path) && cargo build --features async-runtime,async-timer,unstable --no-default-features
# required wasm32-unknown-unknown target
$(Change_Work_Path) && cargo build --features wasm-timer,unstable --no-default-features --target=wasm32-unknown-unknown
bench_p2p:
cd bench && cargo run --release
ci: fmt clippy test examples bench_p2p features-check
git diff --exit-code Cargo.lock
check-moleculec-version:
test "$$(${MOLC} --version | awk '{ print $$2 }' | tr -d ' ')" = ${MOLC_VERSION}
%_mol.rs: %.mol check-moleculec-version
${MOLC} --language rust --schema-file $< | rustfmt > $@
gen-mol: $(MOL_RUST_FILES)
clean-mol:
rm -f $(MOL_RUST_FILES)
.PHONY: fmt clippy test fuzz build examples ci check-moleculec-version gen-mol clean-mol