-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (31 loc) · 1.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
.PHONY: help, copyright
help:
$(info Rewave Makefile)
$(info )
$(info Consider to use 'cargo' instead)
$(info )
@grep '^[[:alnum:]_-]*:.* ##' $(MAKEFILE_LIST) \
| sort | awk 'BEGIN {FS=":.* ## "}; {printf "%-25s %s\n", $$1, $$2};'
run-server: # Run server example
@RUST_BACKTRACE=full RUST_LOG=info cargo run --release --example server
run-client:# Run server client
@RUST_BACKTRACE=full RUST_LOG=info cargo run --release --example client
clean:
@cargo clean
test:
@RUST_BACKTRACE=full RUST_LOG=info cargo test
check-setup:
@type rustup >/dev/null 2>&1 || (echo "Install rustup first. To install, run Run 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh'" >&2 ; exit 1)
@type rustc >/dev/null 2>&1 || (echo "Install rustc first. To install, run Run 'curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh'" >&2 ; exit 1)
lint:
@cargo fix
@cargo clippy --fix -Z unstable-options
@cargo clippy --all-targets --all-features -- -D warnings
format:
@cargo fmt
@echo "Code formatted successfully"
doc:
@cargo doc --target-dir docs
copyright:
@find . -iname "*.rs" -exec bash -c "if ! grep -q Copyright "{}"; then cat COPYRIGHT {} > {}.new && mv {}.new {} ; fi" \;
@echo "Copyright notice added"