forked from irisnet/irishub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
183 lines (143 loc) · 7.54 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation' | grep -v '/prometheus' | grep -v '/clitest' | grep -v '/lcd' | grep -v '/protobuf')
PACKAGES_MODULES=$(shell go list ./... | grep 'modules')
PACKAGES_TYPES=$(shell go list ./... | grep 'irisnet/irishub/types')
PACKAGES_STORE=$(shell go list ./... | grep 'irisnet/irishub/store')
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
export GO111MODULE = on
all: get_tools install build_cur
COMMIT_HASH := $(shell git rev-parse --short HEAD)
InvariantLevel := $(shell if [ -z ${InvariantLevel} ]; then echo "error"; else echo ${InvariantLevel}; fi)
NetworkType := $(shell if [ -z ${NetworkType} ]; then echo "mainnet"; else echo ${NetworkType}; fi)
BUILD_TAGS = netgo
BUILD_FLAGS = -tags "$(BUILD_TAGS)" -ldflags "\
-X github.com/irisnet/irishub/version.GitCommit=${COMMIT_HASH} \
-X github.com/irisnet/irishub/types.InvariantLevel=${InvariantLevel} \
-X github.com/irisnet/irishub/types.NetworkType=${NetworkType}"
LEDGER_ENABLED ?= true
########################################
### Build/Install
ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
GCCEXE = $(shell where gcc.exe 2> NUL)
ifeq ($(GCCEXE),)
$(error gcc.exe not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
BUILD_TAGS += ledger
endif
else
UNAME_S = $(shell uname -s)
ifeq ($(UNAME_S),OpenBSD)
$(warning OpenBSD detected, disabling ledger support (https://github.com/cosmos/cosmos-sdk/issues/1988))
else
GCC = $(shell command -v gcc 2> /dev/null)
ifeq ($(GCC),)
$(error gcc not installed for ledger support, please install or set LEDGER_ENABLED=false)
else
BUILD_TAGS += ledger
endif
endif
endif
endif
########################################
### Tools & dependencies
echo_bech32_prefix:
@echo "If you want to build binaries for testnet, please execute \"source scripts/setTestEnv.sh\" first"
@echo InvariantLevel=${InvariantLevel}
@echo NetworkType=${NetworkType}
check_tools:
cd scripts && $(MAKE) check_tools
check_dev_tools:
cd scripts && $(MAKE) check_dev_tools
update_tools:
cd scripts && $(MAKE) update_tools
update_dev_tools:
cd scripts && $(MAKE) update_dev_tools
get_tools:
cd scripts && $(MAKE) get_tools
get_dev_tools:
cd scripts && $(MAKE) get_dev_tools