Skip to content

Commit

Permalink
new: added makefile (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
pamburus authored Mar 21, 2024
1 parent 7f9e6fa commit 8c515e9
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 8c515e9

Please sign in to comment.