forked from a-h/generate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
43 lines (30 loc) · 664 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
PKG := github.com/a-h/generate
CMD := $(PKG)/cmd/schema-generate
BIN := schema-generate
# Build
.PHONY: all clean
all: clean $(BIN)
$(BIN):
@echo "+ Building $@"
CGO_ENABLED="0" go build -v -o $@ $(CMD)
clean:
@echo "+ Cleaning $(PKG)"
go clean -i $(PKG)/...
rm -f $(BIN)
# Test
.PHONY: test codecheck fmt lint vet
test:
@echo "+ Executing tests for $(PKG)"
go test -v -race -cover $(PKG)/...
codecheck: fmt lint vet
fmt:
@echo "+ go fmt"
go fmt $(PKG)/...
lint: $(GOPATH)/bin/golint
@echo "+ go lint"
golint -min_confidence=0.1 $(PKG)/...
$(GOPATH)/bin/golint:
go get -v golang.org/x/lint/golint
vet:
@echo "+ go vet"
go vet $(PKG)/...