-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
37 lines (30 loc) · 988 Bytes
/
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
# The flags to pass to the `cargo build` command
BUILDFLAGS := --release
# Absolute path to project directory, required for symbolic links
# or when 'make' is run from another directory.
# - credit: https://stackoverflow.com/a/23324703/2726733
ROOT_DIR := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# default rule is to run build/test
all: build test
# builds the project
build:
cd $(ROOT_DIR) && cargo build ${BUILDFLAGS}
# runs tests and linters
test:
cd $(ROOT_DIR) && cargo test --all-targets --all-features
cd $(ROOT_DIR) && cargo fmt -- --check
cd $(ROOT_DIR) && cargo clippy --release
test-full: test
cargo clippy --\
-D warnings\
-W clippy::pedantic\
-A clippy::must_use_candidate\
-A clippy::cast_precision_loss\
-A clippy::cast_possible_truncation\
-A clippy::cast_possible_wrap\
-A clippy::cast_sign_loss\
-A clippy::mut_mut
dev:
cd $(ROOT_DIR) && cargo run --package demo
ascii:
cd $(ROOT_DIR) && cargo run --package demo-ascii