diff --git a/.gitignore b/.gitignore index ef2a69288..63a6a3901 100644 --- a/.gitignore +++ b/.gitignore @@ -27,7 +27,7 @@ out-test tools/ tmp/ bin/ -output/ +_output/ ### OpenIM deploy ### deploy/open_im_demo diff --git a/cmd/Open-IM-SDK-Core b/cmd/Open-IM-SDK-Core deleted file mode 160000 index e731cb86e..000000000 --- a/cmd/Open-IM-SDK-Core +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e731cb86ec9314a0b30b4f8331d53854c2c9d858 diff --git a/script/make-rules/common.mk b/script/make-rules/common.mk index 904a97d75..bb900d8ae 100644 --- a/script/make-rules/common.mk +++ b/script/make-rules/common.mk @@ -87,6 +87,8 @@ PLATFORMS ?= linux_amd64 linux_arm64 # The OS can be linux/windows/darwin when building binaries # PLATFORMS ?= darwin_amd64 windows_amd64 linux_amd64 linux_arm64 +# only support linux +GOOS=linux # set a specific PLATFORM, defaults to the host platform ifeq ($(origin PLATFORM), undefined) diff --git a/script/make-rules/golang.mk b/script/make-rules/golang.mk index e0ae4e399..fe4757ee6 100644 --- a/script/make-rules/golang.mk +++ b/script/make-rules/golang.mk @@ -88,6 +88,11 @@ EXCLUDE_TESTS=github.com/OpenIMSDK/Open-IM-Server/test github.com/OpenIMSDK/Open # BIN_DIR=/root/workspaces/OpenIM/_output/bin # ============================================================================== +## go.build: Build binaries +.PHONY: go.build +go.build: go.build.verify $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS))) + @echo "===========> Building binary $(BINS) $(VERSION) for $(PLATFORM)" + ## go.build.verify: Verify that a suitable version of Go exists .PHONY: go.build.verify go.build.verify: @@ -106,12 +111,7 @@ go.build.%: @echo "=====> BIN_DIR=$(BIN_DIR)" @echo "===========> Building binary $(COMMAND) $(VERSION) for $(OS)_$(ARCH)" @mkdir -p $(OUTPUT_DIR)/platforms/$(OS)/$(ARCH) - @CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o $(OUTPUT_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_PACKAGE)/cmd/$(COMMAND) - -## go.build: Build binaries -.PHONY: go.build -go.build: go.build.verify $(addprefix go.build., $(addprefix $(PLATFORM)., $(BINS))) - @echo "===========> Building binary $(BINS) $(VERSION) for $(PLATFORM)" + @CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o $(OUTPUT_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_DIR)/cmd/$(COMMAND)/main.go ## go.multiarch: Build multi-arch binaries .PHONY: go.build.multiarch diff --git a/script/make-rules/tools.mk b/script/make-rules/tools.mk index 2c6689668..f4b3ddf08 100644 --- a/script/make-rules/tools.mk +++ b/script/make-rules/tools.mk @@ -17,7 +17,7 @@ # Why download to the tools directory, thinking we might often switch Go versions using gvm. # -# sealer build use BUILD_TOOLS +# openim build use BUILD_TOOLS BUILD_TOOLS ?= golangci-lint goimports addlicense deepcopy-gen conversion-gen ginkgo go-junit-report go-gitlint # Code analysis tools ANALYSIS_TOOLS = golangci-lint goimports golines go-callvis kube-score @@ -71,7 +71,6 @@ install.golangci-lint: install.goimports: @$(GO) install golang.org/x/tools/cmd/goimports@latest -# Actions path: https://github.com/sealerio/sealer/tree/main/.github/workflows/go.yml#L37-L50 ## install.addlicense: Install addlicense, used to add license header to source files .PHONY: install.addlicense install.addlicense: