mirror of
https://github.com/adnanh/webhook.git
synced 2025-05-10 15:44:43 +00:00
Add help target to Makefile
This commit is contained in:
parent
34ae132930
commit
8728ec4786
1 changed files with 12 additions and 6 deletions
18
Makefile
18
Makefile
|
@ -1,12 +1,18 @@
|
||||||
OS = darwin freebsd linux openbsd
|
OS = darwin freebsd linux openbsd
|
||||||
ARCHS = 386 arm amd64 arm64
|
ARCHS = 386 arm amd64 arm64
|
||||||
|
|
||||||
|
.DEFAULT_GOAL := help
|
||||||
|
|
||||||
|
.PHONY: help
|
||||||
|
help:
|
||||||
|
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}'
|
||||||
|
|
||||||
all: build release release-windows
|
all: build release release-windows
|
||||||
|
|
||||||
build: deps
|
build: deps ## Build the project
|
||||||
go build
|
go build
|
||||||
|
|
||||||
release: clean deps
|
release: clean deps ## Generate releases for unix systems
|
||||||
@for arch in $(ARCHS);\
|
@for arch in $(ARCHS);\
|
||||||
do \
|
do \
|
||||||
for os in $(OS);\
|
for os in $(OS);\
|
||||||
|
@ -18,7 +24,7 @@ release: clean deps
|
||||||
done \
|
done \
|
||||||
done
|
done
|
||||||
|
|
||||||
release-windows: clean deps
|
release-windows: clean deps ## Generate release for windows
|
||||||
@for arch in $(ARCHS);\
|
@for arch in $(ARCHS);\
|
||||||
do \
|
do \
|
||||||
echo "Building windows-$$arch"; \
|
echo "Building windows-$$arch"; \
|
||||||
|
@ -27,12 +33,12 @@ release-windows: clean deps
|
||||||
tar cz -C build -f build/webhook-windows-$$arch.tar.gz webhook-windows-$$arch; \
|
tar cz -C build -f build/webhook-windows-$$arch.tar.gz webhook-windows-$$arch; \
|
||||||
done
|
done
|
||||||
|
|
||||||
test: deps
|
test: deps ## Execute tests
|
||||||
go test ./...
|
go test ./...
|
||||||
|
|
||||||
deps:
|
deps: ## Install dependencies using go get
|
||||||
go get -d -v -t ./...
|
go get -d -v -t ./...
|
||||||
|
|
||||||
clean:
|
clean: ## Remove building artifacts
|
||||||
rm -rf build
|
rm -rf build
|
||||||
rm -f webhook
|
rm -f webhook
|
||||||
|
|
Loading…
Add table
Reference in a new issue