generated from rog-golang-buddies/golang-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
47 lines (39 loc) · 979 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
SHELL=/bin/bash -e -o pipefail
PWD = $(shell pwd)
GO_BUILD= go build
GOFLAGS= CGO_ENABLED=0
## help: Print this help message
.PHONY: help
help:
@echo "Usage:"
@sed -n 's/^##//p' $(MAKEFILE_LIST) | column -t -s ':' | sed -e 's/^/ /'
## test: Run tests
.PHONY: test
test:
go test -race -v ./...
## cover: Run tests and show coverage result
.PHONY: cover
cover:
go test -v -coverprofile=coverage.out ./...
go tool cover -func=coverage.out
## tidy: Cleanup and download missing dependencies
.PHONY: tidy
tidy:
go mod tidy
go mod verify
## vet: Examine Go source code and reports suspicious constructs
.PHONY: vet
vet:
go vet ./...
## fmt: Format all go source files
.PHONY: fmt
fmt:
go fmt ./...
## build_server: Build server binary into bin/ directory
.PHONY: build
build:
$(GOFLAGS) $(GO_BUILD) -a -v -ldflags="-w -s" -o bin/rmx-server cmd/*.go
# --host should be from ENV
.PHONT: tls
tls:
go run /usr/local/go/src/crypto/tls/generate_cert.go --host=$(HOSTNAME)