2022-09-14 12:22:57 +00:00
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
SHELL := pwsh.exe
|
|
|
|
.SHELLFLAGS := -NoProfile -Command
|
|
|
|
EXT = .exe
|
2022-05-17 10:14:59 +00:00
|
|
|
endif
|
|
|
|
|
2023-07-26 08:24:37 +00:00
|
|
|
GO = go
|
|
|
|
GOBUILD = $(GO) build
|
2022-09-14 12:22:57 +00:00
|
|
|
|
|
|
|
BINARY_NAME = cscli$(EXT)
|
|
|
|
PREFIX ?= "/"
|
2020-05-15 09:39:16 +00:00
|
|
|
BIN_PREFIX = $(PREFIX)"/usr/local/bin/"
|
|
|
|
|
2022-02-01 08:22:47 +00:00
|
|
|
.PHONY: all
|
2020-05-15 09:39:16 +00:00
|
|
|
all: clean build
|
|
|
|
|
|
|
|
build: clean
|
2023-08-28 13:58:26 +00:00
|
|
|
$(GOBUILD) $(LD_OPTS) -o $(BINARY_NAME)
|
2020-05-15 09:39:16 +00:00
|
|
|
|
2022-02-01 08:22:47 +00:00
|
|
|
.PHONY: install
|
2020-05-15 09:39:16 +00:00
|
|
|
install: install-conf install-bin
|
|
|
|
|
|
|
|
install-conf:
|
|
|
|
|
|
|
|
install-bin:
|
|
|
|
@install -v -m 755 -D "$(BINARY_NAME)" "$(BIN_PREFIX)/$(BINARY_NAME)" || exit
|
|
|
|
|
|
|
|
uninstall:
|
2022-05-17 10:14:59 +00:00
|
|
|
@$(RM) $(CSCLI_CONFIG) $(WIN_IGNORE_ERR)
|
|
|
|
@$(RM) $(BIN_PREFIX)$(BINARY_NAME) $(WIN_IGNORE_ERR)
|
2020-05-15 09:39:16 +00:00
|
|
|
|
|
|
|
clean:
|
2023-03-30 13:05:09 +00:00
|
|
|
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)
|