-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (45 loc) · 967 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
46
47
48
49
50
51
52
53
54
55
56
57
58
BASEDIR=$(CURDIR)
TOOLDIR=$(BASEDIR)/script
BINARY=grample
SOURCES := $(shell find $(BASEDIR) -name '*.go')
PACKAGES := $(shell go list ./... | grep -v vendor )
TESTED=.tested
.PHONY: build
build: $(BINARY)
$(BINARY): $(SOURCES) $(TESTED)
@go build ./... 2>&1 | $(TOOLDIR)/color.py
go build
.PHONY: full-build
full-build: clean format lint deps build
.PHONY: install
install: build
go install ./...
.PHONY: clean
clean:
rm -f $(BINARY) debug debug.test *.out cover.html sampler.test $(TESTED)
go clean ./...
.PHONY: deps
deps:
go mod tidy
.PHONY: tool-install
tool-install:
$(TOOLDIR)/tool-install
.PHONY: format
format:
@go fmt $(PACKAGES) 2>&1 | $(TOOLDIR)/color.py
.PHONY: lint
lint: format
$(TOOLDIR)/lint
.PHONY: test
test: $(TESTED)
$(TESTED): $(SOURCES)
$(TOOLDIR)/test
.PHONY: cover
cover: $(SOURCES) $(TESTED)
$(TOOLDIR)/cover
.PHONY: bench
bench: $(SOURCES) $(TESTED)
$(TOOLDIR)/bench
.PHONY: clean
update: clean
$(TOOLDIR)/update