Skip to content

Commit

Permalink
Makefile: Fix archetecture detection
Browse files Browse the repository at this point in the history
Using "arch" instead of "go env GOARCH" is more standard and doesn't
generate a warning on "sudo make install".
  • Loading branch information
josephlr committed Feb 13, 2018
1 parent e131cec commit 3326520
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,16 +181,16 @@ $(BIN)/gocovmerge: $(VENDOR)

# Non-go tools downloaded from appropriate repository
PROTOC_VERSION := 3.5.1
GOARCH := $(shell go env GOARCH)
ifneq ($(findstring amd64,$(GOARCH)),)
ARCH := x86_64
else ifneq ($(findstring 386,$(GOARCH)),)
ARCH := x86_32
else ifneq ($(findstring arm64,$(GOARCH)),)
ARCH := aarch_64
ARCH := $(shell arch)
ifeq (x86_64,$(ARCH))
PROTOC_ARCH := x86_64
else ifneq ($(filter i386 i686,$(ARCH)),)
PROTOC_ARCH := x86_32
else ifneq ($(filter aarch64 aarch64_be armv8b armv8l,$(ARCH)),)
PROTOC_ARCH := aarch_64
endif
ifdef ARCH
PROTOC_URL := https://github.com/google/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-linux-$(ARCH).zip
ifdef PROTOC_ARCH
PROTOC_URL := https://github.com/google/protobuf/releases/download/v$(PROTOC_VERSION)/protoc-$(PROTOC_VERSION)-linux-$(PROTOC_ARCH).zip
$(BIN)/protoc:
wget -q $(PROTOC_URL) -O /tmp/protoc.zip
unzip -q -j /tmp/protoc.zip bin/protoc -d $(BIN)
Expand Down

0 comments on commit 3326520

Please sign in to comment.