From 73effdf644669ed14e5f0a0e1e91111e3579c17b Mon Sep 17 00:00:00 2001 From: Xinwei Xiong <3293172751NSS@gmail.com> Date: Tue, 8 Aug 2023 11:42:36 +0800 Subject: [PATCH] fix: fix bin tools path (#814) Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --- scripts/make-rules/common.mk | 6 ++++++ scripts/make-rules/golang.mk | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/make-rules/common.mk b/scripts/make-rules/common.mk index 93057fef5..0da5af561 100644 --- a/scripts/make-rules/common.mk +++ b/scripts/make-rules/common.mk @@ -46,6 +46,12 @@ BIN_DIR := $(OUTPUT_DIR)/bin $(shell mkdir -p $(BIN_DIR)) endif +# BIN_TOOLS_DIR: Directory where executable files are stored. +ifeq ($(origin BIN_TOOLS_DIR),undefined) +BIN_TOOLS_DIR := $(OUTPUT_DIR)/bin-tools +$(shell mkdir -p $(BIN_TOOLS_DIR)) +endif + # TOOLS_DIR: The directory where tools are stored for build and testing. ifeq ($(origin TOOLS_DIR),undefined) TOOLS_DIR := $(OUTPUT_DIR)/tools diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk index 240556832..cc54d017a 100644 --- a/scripts/make-rules/golang.mk +++ b/scripts/make-rules/golang.mk @@ -132,7 +132,7 @@ go.build.%: $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_DIR)/cmd/$(COMMAND)/main.go; \ elif [ -f $(ROOT_DIR)/tools/$(COMMAND)/main.go ]; then \ CGO_ENABLED=0 GOOS=$(OS) GOARCH=$(ARCH) $(GO) build $(GO_BUILD_FLAGS) -o \ - $(BIN_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_DIR)/tools/$(COMMAND)/main.go; \ + $(BIN_TOOLS_DIR)/platforms/$(OS)/$(ARCH)/$(COMMAND)$(GO_OUT_EXT) $(ROOT_DIR)/tools/$(COMMAND)/main.go; \ fi \ fi @@ -202,8 +202,8 @@ go.updates: tools.verify.go-mod-outdated ## go.clean: Clean all builds directories and files .PHONY: go.clean go.clean: - @echo "===========> Cleaning all builds TMP_DIR($(TMP_DIR)) AND BIN_DIR($(BIN_DIR))" - @-rm -vrf $(TMP_DIR) $(BIN_DIR) + @echo "===========> Cleaning all builds TMP_DIR($(TMP_DIR)) AND BIN_DIR($(BIN_DIR)) AND BIN_TOOLS_DIR($(BIN_TOOLS_DIR))" + @-rm -vrf $(TMP_DIR) $(BIN_DIR) $(BIN_TOOLS_DIR) @echo "===========> End clean..." ## copyright.help: Show copyright help