-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
40 lines (30 loc) · 995 Bytes
/
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
SHELL := /bin/bash
COMMIT_NO := $(shell git rev-parse --short=7 HEAD 2> /dev/null || true)
GIT_COMMIT := $(if $(shell git status --porcelain --untracked-files=no),"${COMMIT_NO}-dirty","${COMMIT_NO}")
LDFLAGS=-ldflags "-s -X main.Version=${GIT_COMMIT}"
.PHONY: help
help: ## This is the help target
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
all: build ## Build wirey for local development
.PHONY: clean
clean: ## Cleanup build directories
$(RM) -r bin/
$(RM) -r dist/
.PHONY: build
build: ## Build wirey for local development
mkdir -p bin
go build ${LDFLAGS} -o bin/wirey ./cmd/wirey
.PHONY: vendor
vendor: ## Execute go mod vendor
go mod vendor
.PHONY: test
test: vendor ## Execute go test
go test -v ./...
.PHONY: fmt
fmt: ## Execute go fmt
go fmt ./...
.PHONY: tidy
tidy: ## Execute go mod tidy
go mod tidy
gorelease: ## Execute goreleaser with snapshot flag
goreleaser release --snapshot --rm-dist