-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (31 loc) · 1.08 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
# This is a template Makefile that I use for automating projects that might
# require one.
#
# For more guidance around Makefiles, the checkout out the helpful
# [makefiletutorial](https://makefiletutorial.com/).
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined $1$(if $2, ($2))))
.PHONY: clean
clean: ## Clean target directory.
@cargo clean
.PHONY: build
build: clean ## Build a debug binary for Tick.
@cargo build
@echo "Binary avaiable at ./target/debug/tick"
.PHONY: release
release: clean ## Build a release binary for Tick.
@cargo build --release
@echo "Binary avaiable at ./target/release/tick"
.PHONY: test
test: clean ## Run the tests for Tick.
@cargo test
.PHONY: update
update: clean ## Update Cargo.lock file with Cargo.toml configuration.
@cargo update
.PHONY: help
help: ## Outputs this help message.
@grep -E '^[0-9a-zA-Z_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'