crowdsec/cmd/crowdsec-cli/Makefile

34 lines
611 B
Makefile
Raw Normal View History

ifeq ($(OS), Windows_NT)
SHELL := pwsh.exe
.SHELLFLAGS := -NoProfile -Command
EXT = .exe
2022-05-17 10:14:59 +00:00
endif
GO = go
GOBUILD = $(GO) build
BINARY_NAME = cscli$(EXT)
PREFIX ?= "/"
2020-05-15 09:39:16 +00:00
BIN_PREFIX = $(PREFIX)"/usr/local/bin/"
.PHONY: all
2020-05-15 09:39:16 +00:00
all: clean build
build: clean
$(GOBUILD) $(LD_OPTS) -o $(BINARY_NAME)
2020-05-15 09:39:16 +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:
@$(RM) $(BINARY_NAME) $(WIN_IGNORE_ERR)