-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
46 lines (31 loc) · 1.53 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
docker_image = docker_developer_environment
.PHONY : help tests check
help: ## Display this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
always:
tests: journey-tests check ## Run all tests
check: ## Compile all relevant configurations of feature flags
cargo check
cargo check --features dev-support
target/debug/cargo-diet: always
cargo build --features dev-support
target/release/cargo-diet: always
cargo build --release
##@ Development
lint: ## Run cargo clippy
cargo clippy
profile: target/release/cargo-diet ## Profile the program using callgrind, needs linux or `make interactive-developer-environment-in-docker`
valgrind --callgrind-out-file=callgrind.profile --tool=callgrind $< >/dev/null
callgrind_annotate --auto=yes callgrind.profile
benchmark: target/release/cargo-diet ## Run CLI benchmarks with hyperfine
hyperfine '$<'
journey-tests: target/debug/cargo-diet ## Run journey-tests
./tests/stateless-journey.sh $<
continuous-journey-tests: ## Run journey-tests, continuously
watchexec $(MAKE) journey-tests
interactive-developer-environment-in-docker: ## Get a prompt into a docker container with all required tools
docker build -t $(docker_image) - < etc/developer.Dockerfile
docker run \
-v ${HOME}/.cargo/registry:/root/.cargo/registry \
-v ${HOME}/.cargo/git:/root/.cargo/git \
-v $$PWD:/volume -w /volume -it $(docker_image)