Files
gocqlx/Makefile
2018-10-23 15:57:24 +02:00

44 lines
806 B
Makefile

all: check test
ifndef GOBIN
export GOBIN := $(GOPATH)/bin
endif
define dl
@curl -sSq -L $(2) -o $(GOBIN)/$(1) && chmod u+x $(GOBIN)/$(1)
endef
define dl_tgz
@curl -sSq -L $(2) | tar zxf - --strip 1 -C $(GOBIN) --wildcards '*/$(1)'
endef
.PHONY: fmt
fmt:
@go fmt ./...
.PHONY: check
check:
@$(GOBIN)/golangci-lint run ./...
GOTEST := go test -cover -race -tags all
.PHONY: test
test:
@$(GOTEST) .
@$(GOTEST) ./migrate
@$(GOTEST) ./qb
@$(GOTEST) ./reflectx
.PHONY: bench
bench:
@go test -tags all -run=XXX -bench=. -benchmem ./...
.PHONY: get-deps
get-deps:
go get -t ./...
.PHONY: get-tools
get-tools:
@echo "==> Installing tools at $(GOBIN)..."
@$(call dl_tgz,golangci-lint,https://github.com/golangci/golangci-lint/releases/download/v1.10.2/golangci-lint-1.10.2-linux-amd64.tar.gz)