From befa7b8138b7ce8019ab400646a64454a8ba1268 Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Tue, 16 Apr 2024 11:32:26 +0200 Subject: [PATCH] Makefile: export GOARCH, GOOS --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f69a9b2b..0578fe67 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,15 @@ NAME = xray VERSION=$(shell git describe --always --dirty) +export GOARCH ?= +export GOOS ?= + +ifdef GOARCH + ifeq ($(GOOS),darwin) + NAME:=$(NAME)-$(GOARCH) + endif +endif + LDFLAGS = -X github.com/xtls/xray-core/core.build=$(VERSION) -s -w -buildid= PARAMS = -trimpath -ldflags "$(LDFLAGS)" -v MAIN = ./main @@ -26,4 +35,4 @@ install: clean: go clean -v -i $(PWD) - rm -f xray xray.exe wxray.exe xray_softfloat \ No newline at end of file + rm -f xray xray.exe wxray.exe xray_softfloat