help:
@echo "USAGE"
@awk -F':' '/##:/ && !/awk/ { OFS="\t"; print "make "$$1,$$3 }' Makefile \
| sort
about:
@banner about
@cargo --version
@rustc --version
@uname -a
all: about build format test docs
build:
@banner build
ptime -m cargo build
ptime -m cargo build --release
docs:
@banner docs
cargo doc
format:
@banner format
cargo fmt -- --check
cargo clippy
.git/hooks/pre-commit:
echo "#!/bin/bash\nmake all" > .git/hooks/pre-commit
chmod +x .git/hooks/pre-commit
hook: .git/hooks/pre-commit
launch:
@find examples -type f -name '*_server.rs' \
| xargs -n1 basename \
| cut -f1 -d'.' \
| xargs -n1 -Iy echo 'cargo run --example y &'
test:
@banner test
true \
&& eval `make launch` \
&& sleep 1 \
&& cargo test \
&& wait