-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
62 lines (45 loc) · 1.72 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
export GO111MODULE=on
#######################
### Current Build Properties
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
BUILD_TAGS = netgo
BUILD_FLAGS = -tags "$(BUILD_TAGS)" -ldflags \
'-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=$(BUILD_TAGS)"'
all: install test
########################################
### Install & Build
build: go.sum build-plasmad build-plasmacli
build-plasmad: go.sum
ifeq ($(OS),Windows_NT)
go build $(BUILD_FLAGS) -o -mod=readonly -o build/plasmad.exe ./cmd/plasmad
else
go build $(BUILD_FLAGS) -o -mod=readonly -o build/plasmad ./cmd/plasmad
endif
build-plasmacli: go.sum
ifeq ($(OS),Windows_NT)
go build $(BUILD_FLAGS) -o -mod=readonly -o build/plasmacli.exe ./cmd/plasmacli
else
go build $(BUILD_FLAGS) -o -mod=readonly -o build/plasmacli ./cmd/plasmacli
endif
install: go.sum install-plasmad install-plasmacli
install-plasmad: go.sum
go install $(BUILD_FLAGS) -mod=readonly ./cmd/plasmad
install-plasmacli: go.sum
go install $(BUILD_FLAGS) -mod=readonly ./cmd/plasmacli
########################################
### Dependencies & Maintenance
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@go mod verify
clean:
rm -rf build/ coverage.txt
########################################
###
test: test-unit
test-unit:
go test -mod=readonly -race -coverprofile=coverage.txt -covermode=atomic -v ./...
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: all build build-plasmad build-plasmacli install install-plasmad install-plasmacli go.sum test test-unit