generated from cosmosregistry/chain-minimal
-
Notifications
You must be signed in to change notification settings - Fork 53
/
Makefile
78 lines (55 loc) · 2.13 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/usr/bin/make -f
PROJECT_NAME=rollappd
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
COMMIT := $(shell git log -1 --format='%H')
# don't override user values
ifeq (,$(VERSION))
VERSION := $(shell git describe --tags)
# if VERSION is empty, then populate it with branch's name and raw commit hash
ifeq (,$(VERSION))
VERSION := $(BRANCH)-$(COMMIT)
endif
endif
ifndef $(GOPATH)
GOPATH=$(shell go env GOPATH)
export GOPATH
endif
TM_VERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
export GO111MODULE = on
# process linker flags
ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=dymension-rdk \
-X github.com/cosmos/cosmos-sdk/version.AppName=rollappd \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TM_VERSION)
BUILD_FLAGS := -ldflags '$(ldflags)'
###########
# Install #
###########
all: install
.PHONY: install
install:
@echo "--> Ensure dependencies have not been modified"
@go mod verify
@echo "--> installing rollappd"
@go install $(BUILD_FLAGS) -v -mod=readonly ./cmd/rollappd
.PHONY: build
build: ## Compiles the rollapd binary
go build -o build/rollappd $(BUILD_FLAGS) ./cmd/rollappd
.PHONY: clean
clean: ## Clean temporary files
go clean
###############################################################################
### Protobuf ###
###############################################################################
protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
containerProtoGen=$(PROJECT_NAME)-proto-gen-$(protoVer)
proto-gen:
@echo "Generating Protobuf files"
@if docker ps -a --format '{{.Names}}' | grep -Eq "^${containerProtoGen}$$"; then docker start -a $(containerProtoGen); else docker run --name $(containerProtoGen) -v $(CURDIR):/workspace --workdir /workspace $(protoImageName) \
sh ./scripts/protogen.sh; fi
@go mod tidy
proto-clean:
@echo "Cleaning proto generating docker container"
@docker rm $(containerProtoGen) || true