Skip to content

Commit

Permalink
Merge pull request #424 from sciclon2/Support-compiling-linux-aarch64
Browse files Browse the repository at this point in the history
Supporting compile the exporter in linux/aarch64 (AKA: arm64)
  • Loading branch information
danielqsj authored Aug 20, 2024
2 parents b41c0c4 + dafc578 commit e32bcec
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
GO := GO111MODULE=on go
PROMU := $(GOPATH)/bin/promu
pkgs = $(shell $(GO) list ./... | grep -v /vendor/)
UNAME_S := $(shell uname -s | tr A-Z a-z)
UNAME_M := $(shell uname -m)

ifeq ($(findstring aarch64,$(UNAME_M)),aarch64)
ARCH := arm64
else
ARCH := $(subst x86_64,amd64,$(patsubst i%86,386,$(UNAME_M)))
endif

PREFIX ?= $(shell pwd)
BIN_DIR ?= $(shell pwd)
Expand Down Expand Up @@ -62,9 +70,7 @@ release: promu github-release
@$(PROMU) release .tarballs

promu:
@GOOS=$(shell uname -s | tr A-Z a-z) \
GOARCH=$(subst x86_64,amd64,$(patsubst i%86,386,$(shell uname -m))) \
$(GO) install github.com/prometheus/promu@v0.14.0
@GOOS=$(UNAME_S) GOARCH=$(ARCH) $(GO) install github.com/prometheus/promu@v0.14.0
PROMU=$(shell go env GOPATH)/bin/promu

github-release:
Expand Down

0 comments on commit e32bcec

Please sign in to comment.