-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
24 lines (17 loc) · 820 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
include hack/base.mk
TARGET_BIN ?= build/bin/benchr
GO_TAGS = -tags 'netgo,osusergo,static_build'
LDFLAGS = -ldflags '-extldflags -static -s -w -X \
github.com/pjbgf/benchr/cmd/cli.version=$(VERSION)'
.PHONY: help
help: ## display Makefile's help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
.PHONY: build
build: ## build benchr to the path set by TARGET_BIN.
go build -trimpath $(GO_TAGS) $(LDFLAGS) -o $(TARGET_BIN) cmd/benchr/main.go
.PHONY: test
test: ## run golang tests.
go test -race -parallel 10 ./...
verify: generate verify-lint verify-dirty ## Run verification checks.
verify-lint: $(GOLANGCI)
$(GOLANGCI) run