diff --git a/Makefile b/Makefile index 3be2bb2..fd05354 100644 --- a/Makefile +++ b/Makefile @@ -17,14 +17,20 @@ LDFLAGS += -X "$(MODULE)/constant.GitCommit=$(BUILD_COMMIT)" GO_BUILD = GO111MODULE=$(GO111MODULE) CGO_ENABLED=$(CGO_ENABLED) \ go build $(BUILD_FLAGS) -ldflags '$(LDFLAGS)' -tags '$(BUILD_TAGS)' -trimpath -PLATFORM_LIST = \ +UNIX_ARCH_LIST = \ darwin-amd64 \ freebsd-amd64 \ freebsd-arm64 \ linux-amd64 \ linux-arm64 \ + linux-mips64 \ + linux-mips64le \ + linux-ppc64 \ + linux-ppc64le \ openbsd-amd64 \ openbsd-arm64 \ + +WINDOWS_ARCH_LIST = \ windows-amd64 \ all: linux-amd64 darwin-amd64 windows-amd64 @@ -47,6 +53,18 @@ linux-amd64: linux-arm64: GOARCH=arm64 GOOS=linux $(GO_BUILD) -o $(BUILD_DIR)/$(BINARY)-$@ +linux-mips64: + GOARCH=mips64 GOOS=linux $(GO_BUILD) -o $(BUILD_DIR)/$(BINARY)-$@ + +linux-mips64le: + GOARCH=mips64le GOOS=linux $(GO_BUILD) -o $(BUILD_DIR)/$(BINARY)-$@ + +linux-ppc64: + GOARCH=ppc64 GOOS=linux $(GO_BUILD) -o $(BUILD_DIR)/$(BINARY)-$@ + +linux-ppc64le: + GOARCH=ppc64le GOOS=linux $(GO_BUILD) -o $(BUILD_DIR)/$(BINARY)-$@ + openbsd-amd64: GOARCH=amd64 GOOS=openbsd $(GO_BUILD) -o $(BUILD_DIR)/$(BINARY)-$@ @@ -56,14 +74,18 @@ openbsd-arm64: windows-amd64: GOARCH=amd64 GOOS=windows $(GO_BUILD) -o $(BUILD_DIR)/$(BINARY)-$@.exe -zip_releases := $(addsuffix .zip, $(PLATFORM_LIST)) +unix_releases := $(addsuffix .zip, $(UNIX_ARCH_LIST)) +windows_releases := $(addsuffix .zip, $(WINDOWS_ARCH_LIST)) -$(zip_releases): %.zip: % - @zip -m -j $(BUILD_DIR)/$(BINARY)-$(basename $@).zip $(BUILD_DIR)/$(BINARY)-$(basename $@)* +$(unix_releases): %.zip: % + @zip -qmj $(BUILD_DIR)/$(BINARY)-$(basename $@).zip $(BUILD_DIR)/$(BINARY)-$(basename $@) -all-arch: $(PLATFORM_LIST) +$(windows_releases): %.zip: % + @zip -qmj $(BUILD_DIR)/$(BINARY)-$(basename $@).zip $(BUILD_DIR)/$(BINARY)-$(basename $@).exe -releases: $(zip_releases) +all-arch: $(UNIX_ARCH_LIST) $(WINDOWS_ARCH_LIST) + +releases: $(unix_releases) $(windows_releases) clean: rm -rf $(BUILD_DIR) diff --git a/README.md b/README.md index c38f7f6..1db9a29 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ English | [简体中文](README_ZH.md) | :----- | :-----: | :---------: | | System | Linux MacOS Freebsd OpenBSD Windows | Linux or MacOS | | Memory | >20MB | >128MB | -| CPU | AMD64 ARM64 | AMD64 with AES-NI & AVX2 | +| CPU | AMD64 ARM64 MIPS64 PPC64 | AMD64 with AES-NI & AVX2 | ## Documentation diff --git a/README_ZH.md b/README_ZH.md index 6989999..b01d7d3 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -39,7 +39,7 @@ | :--- | :---: | :---: | | 系统 | Linux MacOS Freebsd OpenBSD Windows | Linux or MacOS | | 内存 | >20MB | >128MB | -| 架构 | AMD64 ARM64 | AMD64 with AES-NI & AVX2 | +| 架构 | AMD64 ARM64 MIPS64 PPC64 | AMD64 with AES-NI & AVX2 | ## 使用文档 diff --git a/core/device/tun/offset_unix.go b/core/device/tun/offset_unix.go index c667634..a274830 100644 --- a/core/device/tun/offset_unix.go +++ b/core/device/tun/offset_unix.go @@ -1,4 +1,4 @@ -// +build darwin freebsd openbsd +// +build darwin freebsd linux openbsd package tun diff --git a/core/device/tun/tun_linux.go b/core/device/tun/tun_linux_64bit.go similarity index 97% rename from core/device/tun/tun_linux.go rename to core/device/tun/tun_linux_64bit.go index 1f44d3c..68a8cf8 100755 --- a/core/device/tun/tun_linux.go +++ b/core/device/tun/tun_linux_64bit.go @@ -1,3 +1,6 @@ +// +build linux +// +build amd64 arm64 + package tun import ( diff --git a/core/device/tun/tun_wg.go b/core/device/tun/tun_wg.go index 5b57c9d..7b712c6 100755 --- a/core/device/tun/tun_wg.go +++ b/core/device/tun/tun_wg.go @@ -1,4 +1,4 @@ -// +build !linux +// +build !linux !amd64,!arm64 package tun