@@ -21,8 +21,13 @@ ALL_SRC := $(shell find . -name '*.go' \
21
21
22
22
# ALL_PKGS is used with 'go cover' and 'golint'
23
23
ALL_PKGS := $(shell go list $(sort $(dir $(ALL_SRC ) ) ) )
24
-
25
- RACE =-race
24
+ UNAME := $(shell uname -m)
25
+ # Race flag is not supported on s390x architecture
26
+ ifeq ($(UNAME ) , s390x)
27
+ RACE=
28
+ else
29
+ RACE=-race
30
+ endif
26
31
GOTEST =go test -v $(RACE )
27
32
GOLINT =golint
28
33
GOVET =go vet
@@ -187,7 +192,11 @@ elasticsearch-mappings:
187
192
.PHONY : build-examples
188
193
build-examples :
189
194
esc -pkg frontend -o examples/hotrod/services/frontend/gen_assets.go -prefix examples/hotrod/services/frontend/web_assets examples/hotrod/services/frontend/web_assets
195
+ ifeq ($(GOARCH ) , s390x)
196
+ CGO_ENABLED=0 installsuffix=cgo go build -o ./examples/hotrod/hotrod-$(GOOS)-$(GOARCH) ./examples/hotrod/main.go
197
+ else
190
198
CGO_ENABLED=0 installsuffix=cgo go build -o ./examples/hotrod/hotrod-$(GOOS) ./examples/hotrod/main.go
199
+ endif
191
200
192
201
.PHONE : docker-hotrod
193
202
docker-hotrod :
@@ -206,23 +215,43 @@ build-all-in-one-linux: build-ui
206
215
207
216
.PHONY : build-all-in-one
208
217
build-all-in-one : elasticsearch-mappings
218
+ ifeq ($(GOARCH ) , s390x)
219
+ CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/all-in-one/all-in-one-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/all-in-one/main.go
220
+ else
209
221
CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/all-in-one/all-in-one-$(GOOS) $(BUILD_INFO) ./cmd/all-in-one/main.go
222
+ endif
210
223
211
224
.PHONY : build-agent
212
225
build-agent :
226
+ ifeq ($(GOARCH ) , s390x)
227
+ CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/agent/agent-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/agent/main.go
228
+ else
213
229
CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/agent/agent-$(GOOS) $(BUILD_INFO) ./cmd/agent/main.go
230
+ endif
214
231
215
232
.PHONY : build-query
216
233
build-query :
234
+ ifeq ($(GOARCH ) , s390x)
235
+ CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/query/query-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/query/main.go
236
+ else
217
237
CGO_ENABLED=0 installsuffix=cgo go build -tags ui -o ./cmd/query/query-$(GOOS) $(BUILD_INFO) ./cmd/query/main.go
238
+ endif
218
239
219
240
.PHONY : build-collector
220
241
build-collector : elasticsearch-mappings
242
+ ifeq ($(GOARCH ) , s390x)
243
+ CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/collector/collector-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/collector/main.go
244
+ else
221
245
CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/collector/collector-$(GOOS) $(BUILD_INFO) ./cmd/collector/main.go
246
+ endif
222
247
223
248
.PHONY : build-ingester
224
249
build-ingester :
250
+ ifeq ($(GOARCH ) , s390x)
251
+ CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/ingester/ingester-$(GOOS)-$(GOARCH) $(BUILD_INFO) ./cmd/ingester/main.go
252
+ else
225
253
CGO_ENABLED=0 installsuffix=cgo go build -o ./cmd/ingester/ingester-$(GOOS) $(BUILD_INFO) ./cmd/ingester/main.go
254
+ endif
226
255
227
256
.PHONY : docker
228
257
docker : build-ui build-binaries-linux docker-images-only
@@ -239,11 +268,15 @@ build-binaries-windows:
239
268
build-binaries-darwin :
240
269
GOOS=darwin $(MAKE ) build-platform-binaries
241
270
271
+ .PHONY : build-binaries-s390x
272
+ build-binaries-s390x :
273
+ GOOS=linux GOARCH=s390x $(MAKE ) build-platform-binaries
274
+
242
275
.PHONY : build-platform-binaries
243
276
build-platform-binaries : build-agent build-collector build-query build-ingester build-all-in-one build-examples
244
277
245
278
.PHONY : build-all-platforms
246
- build-all-platforms : build-binaries-linux build-binaries-windows build-binaries-darwin
279
+ build-all-platforms : build-binaries-linux build-binaries-windows build-binaries-darwin build-binaries-s390x
247
280
248
281
.PHONY : docker-images-cassandra
249
282
docker-images-cassandra :
0 commit comments