1a6f12c88e
The make tidy target runs "go mod tidy" in the root directory and all plugins.
35 lines
669 B
Makefile
35 lines
669 B
Makefile
ifeq ($(OS), Windows_NT)
|
|
SHELL := pwsh.exe
|
|
.SHELLFLAGS := -NoProfile -Command
|
|
EXT = .exe
|
|
endif
|
|
|
|
# Go parameters
|
|
GO = go
|
|
GOBUILD = $(GO) build
|
|
GOTEST = $(GO) test
|
|
|
|
BINARY_NAME = cscli$(EXT)
|
|
PREFIX ?= "/"
|
|
BIN_PREFIX = $(PREFIX)"/usr/local/bin/"
|
|
|
|
.PHONY: all
|
|
all: clean build
|
|
|
|
build: clean
|
|
$(GOBUILD) $(LD_OPTS) $(BUILD_VENDOR_FLAGS) -o $(BINARY_NAME)
|
|
|
|
.PHONY: install
|
|
install: install-conf install-bin
|
|
|
|
install-conf:
|
|
|
|
install-bin:
|
|
@install -v -m 755 -D "$(BINARY_NAME)" "$(BIN_PREFIX)/$(BINARY_NAME)" || exit
|
|
|
|
uninstall:
|
|
@$(RM) $(CSCLI_CONFIG) $(WIN_IGNORE_ERR)
|
|
@$(RM) $(BIN_PREFIX)$(BINARY_NAME) $(WIN_IGNORE_ERR)
|
|
|
|
clean:
|
|
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|