-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathMakefile
60 lines (45 loc) · 2.1 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
PACKAGES=$(shell go list ./... | grep -v '/simulation')
VERSION := $(shell echo $(shell git describe --tags --dirty) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
COSMOS_SDK := $(shell grep -i cosmos-sdk go.mod | awk '{print $$2}')
include Makefile.ledger
build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))
whitespace :=
whitespace += $(whitespace)
comma := ,
build_tags_comma_sep := $(patsubst $(whitespace),$(comma),$(build_tags))
coverage := $(shell mktemp -u).coverage.out
# process linker flags
LDFLAGS = -X github.com/cosmos/cosmos-sdk/version.Name=BluzelleService \
-X github.com/cosmos/cosmos-sdk/version.ServerName=blzd \
-X github.com/cosmos/cosmos-sdk/version.ClientName=blzcli \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
LDFLAGS_FAUCET = -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep),faucet,cosmos-sdk $(COSMOS_SDK)"
LDFLAGS_NO_FAUCET = -X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep),cosmos-sdk $(COSMOS_SDK)"
BUILD_FLAGS := -tags "$(build_tags)"
FAUCET_BUILD_FLAGS := -tags "$(build_tags),faucet"
all:
go build $(BUILD_FLAGS) -ldflags '$(LDFLAGS) $(LDFLAGS_NO_FAUCET)' ./cmd/blzd
go build $(BUILD_FLAGS) -ldflags '$(LDFLAGS) $(LDFLAGS_NO_FAUCET)' ./cmd/blzcli
clean:
@rm -f blzd blzcli
mainnet: go.sum
go install -mod=readonly $(BUILD_FLAGS) -ldflags '$(LDFLAGS) $(LDFLAGS_NO_FAUCET)' ./cmd/blzd
go install -mod=readonly $(BUILD_FLAGS) -ldflags '$(LDFLAGS) $(LDFLAGS_NO_FAUCET)' ./cmd/blzcli
testnet:
# only testnet has the faucet enabled...
go install -mod=readonly $(FAUCET_BUILD_FLAGS) -ldflags '$(LDFLAGS) $(LDFLAGS_FAUCET)' ./cmd/blzd
go install -mod=readonly $(FAUCET_BUILD_FLAGS) -ldflags '$(LDFLAGS) $(LDFLAGS_FAUCET)' ./cmd/blzcli
go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
GO111MODULE=on go mod verify
test:
@go test -mod=readonly $(PACKAGES)
test-tax:
@go test -mod=readonly ./x/tax/...
coverage:
@go test -v -coverprofile=$(coverage) ./x/...
@go tool cover -html=$(coverage)
@rm $(coverage)