@@ -97,15 +97,17 @@ include contrib/devtools/Makefile
97
97
# ## Build ###
98
98
# ##############################################################################
99
99
100
- build : go.sum
101
- go build -mod=readonly ./...
100
+ BUILD_TARGETS := build install
102
101
103
- simd :
104
- mkdir -p $( BUILDDIR )
105
- go build -mod=readonly $(BUILD_FLAGS ) -o $( BUILDDIR ) ./simapp/simd
102
+ build : BUILD_ARGS=-o $( BUILDDIR ) /
103
+ build-linux :
104
+ GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false $(MAKE ) build
106
105
107
- simd-linux : go.sum
108
- $(MAKE ) simd GOOS=linux GOARCH=amd64 LEDGER_ENABLED=false
106
+ $(BUILD_TARGETS ) : go.sum $(BUILDDIR ) /
107
+ go $@ -mod=readonly $(BUILD_FLAGS ) $(BUILD_ARGS ) ./...
108
+
109
+ $(BUILDDIR ) / :
110
+ mkdir -p $(BUILDDIR ) /
109
111
110
112
build-simd-all : go.sum
111
113
$(if $(shell docker inspect -f '{{ .Id }}' cosmossdk/rbuilder 2>/dev/null) ,$(info found image cosmossdk/rbuilder) ,docker pull cosmossdk/rbuilder:latest)
@@ -119,7 +121,7 @@ build-simd-all: go.sum
119
121
--name latest-build cosmossdk/rbuilder :latest
120
122
docker cp -a latest-build:/home/builder/artifacts/ $(CURDIR ) /
121
123
122
- build-simd-linux : go.sum
124
+ build-simd-linux : go.sum $( BUILDDIR ) /
123
125
$(if $(shell docker inspect -f '{{ .Id }}' cosmossdk/rbuilder 2>/dev/null) ,$(info found image cosmossdk/rbuilder) ,docker pull cosmossdk/rbuilder:latest)
124
126
docker rm latest-build || true
125
127
docker run --volume=$(CURDIR ) :/sources:ro \
@@ -130,13 +132,12 @@ build-simd-linux: go.sum
130
132
--env LEDGER_ENABLED=false \
131
133
--name latest-build cosmossdk/rbuilder :latest
132
134
docker cp -a latest-build:/home/builder/artifacts/ $(CURDIR ) /
133
- mkdir -p $(BUILDDIR )
134
135
cp artifacts/simd-* -linux-amd64 $(BUILDDIR ) /simd
135
136
136
137
cosmovisor :
137
138
$(MAKE ) -C cosmovisor cosmovisor
138
139
139
- .PHONY : build simd simd -linux build-simd-all build-simd-linux cosmovisor
140
+ .PHONY : build build -linux build-simd-all build-simd-linux cosmovisor
140
141
141
142
mocks : $(MOCKS_DIR )
142
143
mockgen -source=client/account_retriever.go -package mocks -destination tests/mocks/account_retriever.go
@@ -152,13 +153,7 @@ mocks: $(MOCKS_DIR)
152
153
$(MOCKS_DIR ) :
153
154
mkdir -p $(MOCKS_DIR )
154
155
155
- distclean : clean
156
- rm -rf \
157
- gitian-build-darwin/ \
158
- gitian-build-linux/ \
159
- gitian-build-windows/ \
160
- .gitian-builder-cache/
161
-
156
+ distclean : clean tools-clean
162
157
clean :
163
158
rm -rf \
164
159
$(BUILDDIR)/ \
@@ -171,15 +166,10 @@ clean:
171
166
# ## Tools & Dependencies ###
172
167
# ##############################################################################
173
168
174
- go-mod-cache : go.sum
175
- @echo " --> Download go modules to local cache"
176
- @go mod download
177
- .PHONY : go-mod-cache
178
-
179
169
go.sum : go.mod
180
- @ echo " --> Ensure dependencies have not been modified"
181
- @ go mod verify
182
- @ go mod tidy
170
+ echo " Ensure dependencies have not been modified ... " >&2
171
+ go mod verify
172
+ go mod tidy
183
173
184
174
# ##############################################################################
185
175
# ## Documentation ###
@@ -459,7 +449,7 @@ proto-update-deps:
459
449
# ##############################################################################
460
450
461
451
# Run a 4-node testnet locally
462
- localnet-start : $( BUILDDIR ) /simd localnet-stop
452
+ localnet-start : build-linux localnet-stop
463
453
$(if $(shell docker inspect -f '{{ .Id }}' cosmossdk/simd-env 2>/dev/null) ,$(info found image cosmossdk/simd-env) ,$(MAKE ) -C contrib/images simd-env)
464
454
if ! [ -f build/node0/simd/config/genesis.json ]; then docker run --rm \
465
455
--user $(shell id -u) :$(shell id -g) \
0 commit comments