|
|
@ -20,9 +20,9 @@ export GO111MODULE=on |
|
|
|
# go source files, ignore vendor directory
|
|
|
|
# go source files, ignore vendor directory
|
|
|
|
SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
|
|
|
|
SRC = $(shell find . -type f -name '*.go' -not -path "./vendor/*")
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all build build-cross clean fmt simplify check bootstrap |
|
|
|
.PHONY: all build build-cross clean fmt simplify check |
|
|
|
|
|
|
|
|
|
|
|
all: check build |
|
|
|
all: clean fmt check build |
|
|
|
|
|
|
|
|
|
|
|
build: |
|
|
|
build: |
|
|
|
$(GO) build -i $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o '$(BINDIR)/$(BINARIES)'
|
|
|
|
$(GO) build -i $(GOFLAGS) -tags '$(TAGS)' -ldflags '$(LDFLAGS)' -o '$(BINDIR)/$(BINARIES)'
|
|
|
@ -42,13 +42,16 @@ simplify: |
|
|
|
|
|
|
|
|
|
|
|
check: |
|
|
|
check: |
|
|
|
@test -z $(shell gofmt -l main.go | tee /dev/stderr) || echo "[WARN] Fix formatting issues with 'make fmt'"
|
|
|
|
@test -z $(shell gofmt -l main.go | tee /dev/stderr) || echo "[WARN] Fix formatting issues with 'make fmt'"
|
|
|
|
@for d in $$(go list ./... | grep -v /vendor/); do golint $${d}; done
|
|
|
|
@golangci-lint run
|
|
|
|
@go vet ${SRC}
|
|
|
|
@go vet ${SRC}
|
|
|
|
|
|
|
|
|
|
|
|
# Check for required executables
|
|
|
|
# Check for required executables
|
|
|
|
HAS_GOX := $(shell command -v gox 2> /dev/null)
|
|
|
|
HAS_GOX := $(shell command -v gox 2> /dev/null)
|
|
|
|
|
|
|
|
HAS_GOLANGCI := $(shell command -v golangci-lint 2> /dev/null)
|
|
|
|
|
|
|
|
|
|
|
|
bootstrap: |
|
|
|
|
|
|
|
ifndef HAS_GOX |
|
|
|
ifndef HAS_GOX |
|
|
|
go get -u github.com/mitchellh/gox
|
|
|
|
go get -u github.com/mitchellh/gox
|
|
|
|
endif |
|
|
|
endif |
|
|
|
|
|
|
|
ifndef HAS_GOLANGCI |
|
|
|
|
|
|
|
go get -u github.com/golangci/golangci-lint/cmd/golangci-lint
|
|
|
|
|
|
|
|
endif |