-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
87 lines (64 loc) · 2.23 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
79
80
81
82
83
84
85
86
87
export GO111MODULE=on
export SMART_CONTRACT_VERSION=fbda08567aac3acd004e36dfe670a44253453907
export LIQUID_STAKING=LiquidStakingV3
export TOKEN_WRAPPER=TokenWrapperV3
export OPENZEPPELIN_VERSION=v3.4.2
VERSION := $(shell echo $(shell git describe --always) | sed 's/^v//')
build_tags = netgo
build_tags += $(BUILD_TAGS)
build_tags := $(strip $(build_tags))
whitespace := $(subst ,, )
comma := ,
build_tags_comma_sep := $(subst $(whitespace),$(comma),$(build_tags))
ldflags = -X github.com/persistenceOne/persistenceBridge/application/commands.Version=$(VERSION)
ifeq (cleveldb,$(findstring cleveldb,$(build_tags)))
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=cleveldb
endif
ifeq (badgerdb,$(findstring badgerdb,$(build_tags)))
ldflags += -X github.com/cosmos/cosmos-sdk/types.DBBackend=badgerdb
endif
ifeq (rocksdb,$(findstring rocksdb,$(build_tags)))
CGO_ENABLED=1
endif
BUILD_FLAGS += -ldflags "${ldflags}" -tags "${build_tags}"
GOBIN = $(shell go env GOPATH)/bin
GOARCH = $(shell go env GOARCH)
GOOS = $(shell go env GOOS)
.PHONY: all install build verify
all: verify install
install:
.script/compileSC.sh
ifeq (${OS},Windows_NT)
go build -mod=readonly ${BUILD_FLAGS} -o ${GOBIN}/persistenceBridge.exe ./orchestrator
else
go build -mod=readonly ${BUILD_FLAGS} -o ${GOBIN}/persistenceBridge ./orchestrator
endif
build:
.script/compileSC.sh
ifeq (${OS},Windows_NT)
go build ${BUILD_FLAGS} -o build/${GOOS}/${GOARCH}/persistenceBridge.exe ./orchestrator
else
go build ${BUILD_FLAGS} -o build/${GOOS}/${GOARCH}/persistenceBridge ./orchestrator
endif
verify:
@echo "verifying modules"
@go mod verify
release: build
mkdir -p release
ifeq (${OS},Windows_NT)
tar -czvf release/persistenceBridge-${GOOS}-${GOARCH}.tar.gz --directory=build/${GOOS}/${GOARCH} persistenceBridge.exe
else
tar -czvf release/persistenceBridge-${GOOS}-${GOARCH}.tar.gz --directory=build/${GOOS}/${GOARCH} persistenceBridge
endif
test:
@go test ./application/casp
@go test ./application/commands
@go test ./application/configuration
@go test ./application/db
@go test ./application/outgoingTx
@go test ./application/rest
@go test ./application/rpc
@go test ./application/shutdown
@go test ./ethereum/contracts
@go test ./ethereum
@go test ./tendermint