-
Notifications
You must be signed in to change notification settings - Fork 34
/
Makefile
48 lines (38 loc) · 1.22 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
44
45
46
47
48
.DEFAULT_GOAL := default
VERSION := $(shell git describe --tags | sed 's/^v//' | rev | cut -d - -f 2- | rev)
COMMIT := $(shell git log -1 --format='%H')
TAGS := $(strip netgo)
LD_FLAGS := -s -w \
-X github.com/cosmos/cosmos-sdk/version.Name=sentinel \
-X github.com/cosmos/cosmos-sdk/version.AppName=sentinelnode \
-X github.com/cosmos/cosmos-sdk/version.Version=${VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${TAGS}
.PHONY: benchmark
benchmark:
@go test -bench -mod=readonly -v ./...
.PHONY: build
build:
go build -ldflags="${LD_FLAGS}" -mod=readonly -tags="${TAGS}" -trimpath \
-o ./bin/sentinelnode main.go
.PHONY: clean
clean:
rm -rf ./bin ./vendor
.PHONY: default
default: clean build
.PHONY: install
install:
go build -ldflags="${LD_FLAGS}" -mod=readonly -tags="${TAGS}" -trimpath \
-o "${GOPATH}/bin/sentinelnode" main.go
.PHONY: build-image
build-image:
@docker build --compress --file Dockerfile --force-rm --tag sentinel-dvpn-node .
.PHONY: go-lint
go-lint:
@golangci-lint run --fix
.PHONY: test
test:
@go test -cover -mod=readonly -v ./...
.PHONY: tools
tools:
@go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1