diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..79525876 --- /dev/null +++ b/Makefile @@ -0,0 +1,36 @@ +.DEFAULT_GOAL := build + +## Print help +help: + @echo "$$(tput setaf 2)Usage$$(tput sgr0)";sed -ne"/^## /{h;s/.*//;:d" -e"H;n;s/^## /---/;td" -e"s/:.*//;G;s/\\n## /===/;s/\\n//g;p;}" ${MAKEFILE_LIST}|awk -F === -v n=$$(tput cols) -v i=4 -v a="$$(tput setaf 6)" -v z="$$(tput sgr0)" '{printf" '$$(tput setaf 2)make$$(tput sgr0)' %s%s%s\n",a,$$1,z;m=split($$2,w,"---");l=n-i;for(j=1;j<=m;j++){l-=length(w[j])+1;if(l<= 0){l=n-i-length(w[j])-1;}printf"%*s%s\n",-i," ",w[j];}}' +.PHONY: help + +## Build debug target +build: + @cargo build +.PHONY: build + +## Build release target +build-release: + @cargo build --release --locked +.PHONY: build-release + +## Install binary +install: + @cargo install --path . --locked +.PHONY: install + +## Run tests +test: + @cargo test +.PHONY: test + +## Run benchmarks +bench: + @cargo bench +.PHONY: bench + +## Clean build artifacts +clean: + @cargo clean +.PHONY: clean