diff --git a/Makefile b/Makefile index 5157169..fcf7fbb 100644 --- a/Makefile +++ b/Makefile @@ -140,16 +140,25 @@ ifeq ($(origin GOBIN), undefined) GOBIN := $(GOPATH)/bin endif -COMMANDS ?= $(filter-out %.md, $(wildcard ${ROOT_DIR}/server/cmd/*)) -BINS ?= $(foreach cmd,${COMMANDS},$(notdir ${cmd})) +ifeq ($(OS),Windows_NT) + NULL := + SPACE := $(NULL) $(NULL) + ROOT_DIR := $(subst $(SPACE),\$(SPACE),$(shell cd)) +else + ROOT_DIR := $(shell pwd) +endif -ifeq (${COMMANDS},) +COMMANDS := $(filter-out %.md, $(wildcard $(ROOT_DIR)/server/cmd/*)) +BINS := $(notdir $(COMMANDS)) + +ifeq ($(strip $(COMMANDS)),) $(error Could not determine COMMANDS, set ROOT_DIR or run in source dir) endif -ifeq (${BINS},) +ifeq ($(strip $(BINS)),) $(error Could not determine BINS, set ROOT_DIR or run in source dir) endif + EXCLUDE_TESTS=github.com/OpenIMSDK/OpenKF/test # ==============================================================================