GO := go
GO_BUILD := $(GO) build
export GOBIN ?= $(shell pwd)/bin
export GO111MODULE := on
rec_wildcard = $(foreach d,$(wildcard $1*),$(call rec_wildcard,$d/,$2) $(filter $(subst *,%,$2),$d))
SRC := $(call rec_wildcard,,*.go) go.mod go.sum
MAKE2HELP := $(GOBIN)/make2help
STATIC_CHECK = $(GOBIN)/staticcheck
$(GOBIN)/%:
@scripts/tools.sh $(notdir $@)
.DEFAULT_GOAL := help
.PHONY: fmt lint test tools clean help
fmt:
$(GO) fmt ./...
lint: $(STATIC_CHECK)
$(GO) vet ./...
$(STATIC_CHECK) ./...
test:
$(GO) test -race ./...
tools:
@scripts/tools.sh
clean:
$(GO) clean
help: $(MAKE2HELP)
@$(MAKE2HELP)