forked from filecoin-project/specs-actors
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
40 lines (29 loc) · 866 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
GO_BIN ?= go
all: build lint test tidy
.PHONY: all
build:
$(GO_BIN) build ./...
.PHONY: build
test:
$(GO_BIN) test ./...
.PHONY: test
test-coverage:
$(GO_BIN) test -coverprofile=coverage.out ./...
.PHONY: test-coverage
tidy:
$(GO_BIN) mod tidy
.PHONY: tidy
gen:
$(GO_BIN) run ./gen/gen.go
.PHONY: gen
# tools
toolspath:=support/tools
$(toolspath)/bin/golangci-lint: $(toolspath)/go.mod
@mkdir -p $(dir $@)
(cd $(toolspath); go build -tags tools -o $(@:$(toolspath)/%=%) github.com/golangci/golangci-lint/cmd/golangci-lint)
$(toolspath)/bin/no-map-range.so: $(toolspath)/go.mod
@mkdir -p $(dir $@)
(cd $(toolspath); go build -tags tools -buildmode=plugin -o $(@:$(toolspath)/%=%) github.com/Kubuxu/go-no-map-range/plugin)
lint: $(toolspath)/bin/golangci-lint $(toolspath)/bin/no-map-range.so
$(toolspath)/bin/golangci-lint run ./...
.PHONY: lint