crowdsec/cmd/crowdsec-cli/Makefile
AlteredCoder 60740f6279
fix makefile for static binaries (#764)
* Fix LD_OPTS for static build

Co-authored-by: AlteredCoder <AlteredCoder>
Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
2021-04-26 14:45:52 +02:00

31 lines
588 B
Makefile

# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
BINARY_NAME=cscli
PREFIX?="/"
BIN_PREFIX = $(PREFIX)"/usr/local/bin/"
all: clean build
build: clean
@$(GOBUILD) $(LD_OPTS) -o $(BINARY_NAME) -v
static: clean
@$(GOBUILD) $(LD_OPTS_STATIC) -o $(BINARY_NAME) -v -a -tags netgo
install: install-conf install-bin
install-conf:
install-bin:
@install -v -m 755 -D "$(BINARY_NAME)" "$(BIN_PREFIX)/$(BINARY_NAME)" || exit
uninstall:
@rm -rf $(CSCLI_CONFIG)
@rm -rf $(BIN_PREFIX)$(BINARY_NAME)
clean:
@rm -f $(BINARY_NAME)