-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (35 loc) · 1.23 KB
/
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
# ==================================================================================== #
# QUALITY CONTROL
# ==================================================================================== #
## tidy: format code and tidy modfile
.PHONY: tidy
tidy:
go fmt ./...
go mod tidy -v
## audit: run quality control checks
.PHONY: audit
audit:
go vet ./...
go run honnef.co/go/tools/cmd/staticcheck@latest -checks=all,-ST1000,-U1000 ./...
go test -race -vet=off ./...
go mod verify
# ==================================================================================== #
# BUILD
# ==================================================================================== #
## build: build the cmd application
.PHONY: build
build:
go mod verify
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags "-s -w -X main.version=9.9.9" -a -o ./bin/hntop ./cmd/hntop
## run: run the cmd application
.PHONY: run
run: build
./bin/hntop
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
help:
@echo 'Usage:'
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'