Skip to content

Commit

Permalink
fix: fix bin tools path (#814)
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>
  • Loading branch information
cubxxw authored Aug 8, 2023
1 parent c8971de commit 73effdf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions scripts/make-rules/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions scripts/make-rules/golang.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 73effdf

Please sign in to comment.