Makefile: export GOARCH, GOOS

This commit is contained in:
Andrej Mihajlov 2024-04-16 11:32:26 +02:00 committed by yuhan6665
parent 0c61752829
commit befa7b8138

View File

@ -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
rm -f xray xray.exe wxray.exe xray_softfloat