* rm -f => $(RM) * PHONY targets * remove email plugin binary on cleanup * unused make variables
34 lines
620 B
Makefile
34 lines
620 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/"
|
|
|
|
.PHONY: all
|
|
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
|
|
|
|
.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) -r $(CSCLI_CONFIG)
|
|
@$(RM) -r $(BIN_PREFIX)$(BINARY_NAME)
|
|
|
|
clean:
|
|
@$(RM) $(BINARY_NAME)
|