-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
57 lines (47 loc) · 992 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
BIN_DIR ?= ./bin
BIN_NAME ?= hbd
define build
go build \
-mod=vendor \
-tags='$(BUILD_TAGS)' \
-gcflags='-e' \
-ldflags='-s -w' \
-o $(BIN_DIR)/$(BIN_NAME) \
./cmd/hbd
endef
## release: publishes binaries to gh
release:
goreleaser
## build: builds hbd binary
build:
$(call build)
## tag: creates a new git tag
tag:
git tag -a $(VERSION) -m "$(VERSION)"
git push origin $(VERSION)
## imports: runs goimports
imports:
goimports -w $(shell find . -type f -name '*.go' -not -path "./vendor/*")
## lint: runs golint
lint:
golint ./...
## test: runs go test
test:
go test ./...
## vet: runs go vet
vet:
go vet ./...
## staticcheck: runs staticcheck
staticcheck:
staticcheck $(shell go list ./...)
.PHONY: vendor
## vendor: updates vendored dependencies
vendor:
rm -f vendor go.sum || :
go mod init || :
go mod tidy
go mod vendor
## help: prints this help message
help:
@echo "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'