|
@ -8,11 +8,9 @@ DEPLOY_ACCOUNT := appleboy |
|
|
DEPLOY_IMAGE := $(EXECUTABLE) |
|
|
DEPLOY_IMAGE := $(EXECUTABLE) |
|
|
|
|
|
|
|
|
TARGETS ?= linux darwin windows |
|
|
TARGETS ?= linux darwin windows |
|
|
PACKAGES ?= $(shell $(GO) list ./...) |
|
|
|
|
|
SOURCES ?= $(shell find . -name "*.go" -type f) |
|
|
SOURCES ?= $(shell find . -name "*.go" -type f) |
|
|
TAGS ?= |
|
|
TAGS ?= |
|
|
LDFLAGS ?= -X 'main.Version=$(VERSION)' |
|
|
LDFLAGS ?= -X 'main.Version=$(VERSION)' |
|
|
TMPDIR := $(shell mktemp -d 2>/dev/null || mktemp -d -t 'tempdir') |
|
|
|
|
|
|
|
|
|
|
|
ifneq ($(shell uname), Darwin) |
|
|
ifneq ($(shell uname), Darwin) |
|
|
EXTLDFLAGS = -extldflags "-static" $(null) |
|
|
EXTLDFLAGS = -extldflags "-static" $(null) |
|
@ -32,7 +30,7 @@ fmt: |
|
|
$(GOFMT) -w $(SOURCES) |
|
|
$(GOFMT) -w $(SOURCES) |
|
|
|
|
|
|
|
|
vet: |
|
|
vet: |
|
|
$(GO) vet $(PACKAGES) |
|
|
$(GO) vet ./... |
|
|
|
|
|
|
|
|
lint: |
|
|
lint: |
|
|
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
|
@hash revive > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
|
|
@ -64,7 +62,7 @@ fmt-check: |
|
|
fi; |
|
|
fi; |
|
|
|
|
|
|
|
|
test: fmt-check |
|
|
test: fmt-check |
|
|
@$(GO) test -v -cover -coverprofile coverage.txt $(PACKAGES) && echo "\n==>\033[32m Ok\033[m\n" || exit 1 |
|
|
@$(GO) test -v -cover -coverprofile coverage.txt ./... && echo "\n==>\033[32m Ok\033[m\n" || exit 1 |
|
|
|
|
|
|
|
|
install: $(SOURCES) |
|
|
install: $(SOURCES) |
|
|
$(GO) install -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' |
|
|
$(GO) install -v -tags '$(TAGS)' -ldflags '$(EXTLDFLAGS)-s -w $(LDFLAGS)' |
|
|