60740f6279
* Fix LD_OPTS for static build Co-authored-by: AlteredCoder <AlteredCoder> Co-authored-by: Sebastien Blot <sebastien@crowdsec.net>
31 lines
588 B
Makefile
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)
|