-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathMakefile
35 lines (26 loc) · 804 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
PKG := github.com/goccy/go-zetasqlite
GOBIN := $(CURDIR)/bin
PKGS := $(shell go list ./... | grep -v cmd | grep -v benchmarks )
COVER_PKGS := $(foreach pkg,$(PKGS),$(subst $(PKG),.,$(pkg)))
COMMA := ,
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
COVERPKG_OPT := $(subst $(SPACE),$(COMMA),$(COVER_PKGS))
$(GOBIN):
@mkdir -p $(GOBIN)
.PHONY: build
build:
cd ./cmd/zetasqlite-cli && go build .
.PHONY: cover
cover:
go test -coverpkg=$(COVERPKG_OPT) -coverprofile=cover.out ./...
.PHONY: cover-html
cover-html: cover
go tool cover -html=cover.out
.PHONY: lint
lint: lint/install
$(GOBIN)/golangci-lint run --timeout 30m
lint/fix: lint/install
$(GOBIN)/golangci-lint run --fix --timeout 30m
lint/install: | $(GOBIN)
GOBIN=$(GOBIN) go install github.com/golangci/golangci-lint/cmd/[email protected]