You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2022/01/21 00:47:53 UTC
[skywalking-infra-e2e] branch main updated: Support arbitrary os and arch (#69)
This is an automated email from the ASF dual-hosted git repository.
kezhenxu94 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git
The following commit(s) were added to refs/heads/main by this push:
new 70cd94b Support arbitrary os and arch (#69)
70cd94b is described below
commit 70cd94ba1104a6d94d52c4979c37d7294a801f90
Author: Jiajing LU <lu...@gmail.com>
AuthorDate: Fri Jan 21 08:47:45 2022 +0800
Support arbitrary os and arch (#69)
---
Makefile | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/Makefile b/Makefile
index 26a1b74..d7b224d 100644
--- a/Makefile
+++ b/Makefile
@@ -19,12 +19,12 @@
PROJECT := e2e
VERSION ?= latest
OUT_DIR = bin
-ARCH := $(shell uname)
-OSNAME := $(if $(findstring Darwin,$(ARCH)),darwin,linux)
HUB ?= docker.io/apache
GO := GO111MODULE=on go
GO_PATH = $(shell $(GO) env GOPATH)
+GOARCH ?= $(shell $(GO) env GOARCH)
+GOOS ?= $(shell $(GO) env GOOS)
GO_BUILD = $(GO) build
GO_TEST = $(GO) test
GO_LINT = $(GO_PATH)/bin/golangci-lint
@@ -32,7 +32,6 @@ GO_BUILD_LDFLAGS = -X github.com/apache/skywalking-$(PROJECT)/commands.version=$
PLATFORMS := windows linux darwin
os = $(word 1, $@)
-ARCH = amd64
RELEASE_BIN = skywalking-$(PROJECT)-$(VERSION)-bin
RELEASE_SRC = skywalking-$(PROJECT)-$(VERSION)-src
@@ -56,7 +55,7 @@ test: clean
.PHONY: $(PLATFORMS)
$(PLATFORMS):
mkdir -p $(OUT_DIR)
- GOOS=$(os) GOARCH=$(ARCH) $(GO_BUILD) $(GO_BUILD_FLAGS) -ldflags "$(GO_BUILD_LDFLAGS)" -o $(OUT_DIR)/$(os)/$(PROJECT) cmd/main.go
+ GOOS=$(os) GOARCH=$(GOARCH) $(GO_BUILD) $(GO_BUILD_FLAGS) -ldflags "$(GO_BUILD_LDFLAGS)" -o $(OUT_DIR)/$(os)/$(PROJECT) cmd/main.go
.PHONY: build
build: windows linux darwin
@@ -99,9 +98,9 @@ release: verify release-src release-bin
shasum -a 512 $(RELEASE_BIN).tgz > $(RELEASE_BIN).tgz.sha512
.PHONY: install
-install: $(OSNAME)
- -cp $(OUT_DIR)/$(OSNAME)/$(PROJECT) $(DESTDIR)
+install: $(GOOS)
+ -cp $(OUT_DIR)/$(GOOS)/$(PROJECT) $(DESTDIR)
.PHONY: uninstall
-uninstall: $(OSNAME)
+uninstall: $(GOOS)
-rm $(DESTDIR)/$(PROJECT)