.PHONY: all header build test test-doc test-cover clippy fmt fmt-fix doc clean deps
ifeq ($(OS),Windows_NT)
IS_WINDOWS := 1
else
IS_WINDOWS :=
endif
header:
ifdef IS_WINDOWS
@echo.
@echo ____ _ _
@echo ^| _ \ __ _ ^| ^| __ __ _ ___ ^(_^) _ __
@echo ^| ^|_) / _` ^|^| ^|/ // _` / __^|^| ^|^| '__^|
@echo ^| __/ ^(_^| ^|^| ^<^| ^(_^| \__ \^| ^|^| ^|
@echo ^|_^| \__,_^|^|_^|\_\\__,_^|___/^|_^|^|_^|
@echo.
@echo Rust SDK by H0llyW00dzZ ^(@github.com/H0llyW00dzZ^)
@echo.
else
@printf '%s\n' ' ____ _ _ '
@printf '%s\n' ' | _ \ __ _ | | __ __ _ ___ (_) _ __ '
@printf '%s\n' ' | |_) / _` || |/ // _` / __|| || '"'"'__| '
@printf '%s\n' ' | __/ (_| || <| (_| \__ \| || | '
@printf '%s\n' ' |_| \__,_||_|\_\\__,_|___/|_||_| '
@printf '%s\n' ' '
@printf '%s\n' ' Rust SDK by H0llyW00dzZ (@github.com/H0llyW00dzZ)'
@echo ""
endif
all: header build test
build: header
@echo "==> Building all targets..."
cargo build --all-targets
@echo "==> Done."
test: header
@echo "==> Running tests..."
cargo test --all-targets
@echo "==> Done."
test-doc: header
@echo "==> Running doc tests..."
cargo test --doc --all-features
@echo "==> Done."
test-cover: header
@echo "==> Running tests with coverage..."
cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
cargo llvm-cov --all-features --workspace --summary-only
@echo "==> Done. (lcov.info written; cargo llvm-cov --open for HTML)"
clippy: header
@echo "==> Running clippy..."
cargo clippy --all-targets --all-features -- -D warnings
@echo "==> Done."
fmt: header
@echo "==> Checking rustfmt..."
cargo fmt --all -- --check
@echo "==> Done."
fmt-fix: header
@echo "==> Applying rustfmt..."
cargo fmt --all
@echo "==> Done."
doc: header
@echo "==> Building docs..."
cargo doc --no-deps
@echo "==> Done. (cargo doc --no-deps --open to view)"
clean: header
cargo clean
rm -f lcov.info
@echo "==> Cleaned."
deps: header
cargo install cargo-llvm-cov
@echo "==> Done."