-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (56 loc) · 2.85 KB
/
Makefile
File metadata and controls
70 lines (56 loc) · 2.85 KB
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
# Fetch git latest tag
LATEST_GIT_TAG:=$(shell git describe --tags $(git rev-list --tags --max-count=1))
VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//')
COMMIT := $(shell git log -1 --format='%H')
ldflags = -X github.com/bttcprotocol/delivery/version.Name=delivery \
-X github.com/bttcprotocol/delivery/version.ServerName=deliveryd \
-X github.com/bttcprotocol/delivery/version.ClientName=deliverycli \
-X github.com/bttcprotocol/delivery/version.Version=$(VERSION) \
-X github.com/bttcprotocol/delivery/version.Commit=$(COMMIT) \
-X github.com/cosmos/cosmos-sdk/version.Name=delivery \
-X github.com/cosmos/cosmos-sdk/version.ServerName=deliveryd \
-X github.com/cosmos/cosmos-sdk/version.ClientName=deliverycli \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT)
BUILD_FLAGS := -ldflags '$(ldflags)'
clean:
rm -rf build
tests:
# go test -v ./...
go test -v ./app/ ./auth/ ./clerk/ ./sidechannel/ ./bank/ ./chainmanager/ ./topup/ ./checkpoint/ ./staking/ -cover -coverprofile=cover.out
build: clean
mkdir -p build
go build -o build/deliveryd ./cmd/deliveryd
go build -o build/deliverycli ./cmd/deliverycli
@echo "====================================================\n==================Build Successful==================\n===================================================="
install:
go install $(BUILD_FLAGS) ./cmd/deliveryd
go install $(BUILD_FLAGS) ./cmd/deliverycli
contracts:
abigen --abi=contracts/rootchain/rootchain.abi --pkg=rootchain --out=contracts/rootchain/rootchain.go
abigen --abi=contracts/stakemanager/stakemanager.abi --pkg=stakemanager --out=contracts/stakemanager/stakemanager.go
abigen --abi=contracts/slashmanager/slashmanager.abi --pkg=slashmanager --out=contracts/slashmanager/slashmanager.go
abigen --abi=contracts/statereceiver/statereceiver.abi --pkg=statereceiver --out=contracts/statereceiver/statereceiver.go
abigen --abi=contracts/statesender/statesender.abi --pkg=statesender --out=contracts/statesender/statesender.go
abigen --abi=contracts/stakinginfo/stakinginfo.abi --pkg=stakinginfo --out=contracts/stakinginfo/stakinginfo.go
abigen --abi=contracts/validatorset/validatorset.abi --pkg=validatorset --out=contracts/validatorset/validatorset.go
abigen --abi=contracts/erc20/erc20.abi --pkg=erc20 --out=contracts/erc20/erc20.go
#
# Code quality
#
LINT_COMMAND := $(shell command -v golangci-lint 2> /dev/null)
lint:
ifndef LINT_COMMAND
go get github.com/golangci/golangci-lint/cmd/golangci-lint@v1.41.1
endif
golangci-lint run
#
# docker commands
#
build-docker:
@echo Fetching latest tag: $(LATEST_GIT_TAG)
git checkout $(LATEST_GIT_TAG)
docker build -t "delivery:$(LATEST_GIT_TAG)" -f docker/Dockerfile .
build-docker-develop:
docker build -t "delivery:develop" -f docker/Dockerfile.develop .
.PHONY: contracts build