-
Notifications
You must be signed in to change notification settings - Fork 23
/
Makefile
33 lines (25 loc) · 837 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
#make
PKG_LIST := $(shell go list ./... | grep -v /vendor/)
.PHONY:
dep: ## Get the dependencies
@go mod vendor
.PHONY:
vet: ## Run go vet
@go vet ${PKG_LIST}
.PHONY:
test: ## Run unit tests
@go test -short ${PKG_LIST}
.PHONY:
test-coverage: ## Run tests with coverage
mkdir -p reports
@go test -short -coverprofile reports/cover.out ${PKG_LIST}
@go tool cover -html reports/cover.out -o reports/cover.html
.PHONY:
build: dep ## Build the binary file
@go build -a -ldflags '-s -w -extldflags "-static"' -o solace_prometheus_exporter
.PHONY:
clean: ## Remove previous build
@rm -f reports/cover.html reports/cover.out solace_prometheus_exporter
.PHONY:
help: ## Display this help screen
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'