Skip to content

Commit

Permalink
Multi-arch build for upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
kcrane committed Oct 27, 2023
1 parent 6361a63 commit ac891e3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ ifeq ($(shell uname -ms),Darwin arm64)
# BUILD_IMAGE = quay.io/rhacs-eng/sandbox:apollo-ci-stackrox-build-0.3.49-arm64
ARCH := aarch64
GOARCH := arm64
else ifeq ($(shell uname -m),s390x)
ARCH := s390x
GOARCH := s390x
else ifeq ($(shell uname -m),ppc64le)
ARCH := ppc64le
GOARCH := ppc64le
else
ARCH := x86_64
GOARCH := amd64
Expand Down
18 changes: 14 additions & 4 deletions make/protogen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,25 @@ GENERATED_API_SWAGGER_SPECS = $(API_SERVICE_PROTOS:%.proto=$(GENERATED_BASE_PATH
PROTOC_VERSION := 21.4
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
PROTOC_ARCH = linux
PROTOC_OS = linux
endif
ifeq ($(UNAME_S),Darwin)
PROTOC_ARCH = osx
PROTOC_OS = osx
endif
UNAME_M := $(shell uname -m)
ifeq ($(UNAME_M),x86_64)
PROTOC_ARCH = x86_64
endif
ifeq ($(UNAME_M),s390x)
PROTOC_ARCH = s390_64
endif
ifeq ($(UNAME_M),ppc64le)
PROTOC_ARCH = ppcle_64
endif

PROTO_PRIVATE_DIR := $(BASE_PATH)/.proto

PROTOC_DIR := $(PROTO_PRIVATE_DIR)/protoc-$(PROTOC_ARCH)-$(PROTOC_VERSION)
PROTOC_DIR := $(PROTO_PRIVATE_DIR)/protoc-$(PROTOC_OS)-$(PROTOC_VERSION)

PROTOC := $(PROTOC_DIR)/bin/protoc

Expand All @@ -53,7 +63,7 @@ $(PROTO_GOBIN):
@echo "+ $@"
$(SILENT)mkdir -p "$@"

PROTOC_ZIP := protoc-$(PROTOC_VERSION)-$(PROTOC_ARCH)-x86_64.zip
PROTOC_ZIP := protoc-$(PROTOC_VERSION)-$(PROTOC_OS)-$(PROTOC_ARCH).zip
PROTOC_FILE := $(PROTOC_DOWNLOADS_DIR)/$(PROTOC_ZIP)

$(PROTOC_FILE): $(PROTOC_DOWNLOADS_DIR)
Expand Down

0 comments on commit ac891e3

Please sign in to comment.