-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
45 lines (37 loc) · 831 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
36
37
38
39
40
41
42
43
44
45
.DEFAULT_GOAL := help
GOCMD := env GO111MODULE=on go
GOMOD := $(GOCMD) mod
GOCLEAN := $(GOCMD) clean
GOINSTALL := $(GOCMD) install
GOTEST := $(GOCMD) test
.PHONY: deps
## Install dependencies
deps:
$(GOMOD) download
.PHONY: devel-deps
## Install dependencies for develop
devel-deps: deps
$(GOINSTALL) golang.org/x/tools/cmd/goimports@latest
$(GOINSTALL) golang.org/x/lint/golint@latest
$(GOINSTALL) github.com/Songmu/make2help/cmd/make2help@latest
.PHONY: test
## Run tests
test: deps
$(GOTEST) -v ./...
.PHONY: lint
## Lint
lint: devel-deps
go vet ./...
golint -set_exit_status ./...
.PHONY: fmt
## Format source codes
fmt: devel-deps
find . -name "*.go" -not -path "./vendor/*" | xargs goimports -w
.PHONY: clean
clean:
$(GOCLEAN)
rm -rf $(BUILDDIR)
.PHONY: help
## Show help
help:
@make2help $(MAKEFILE_LIST)