-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
57 lines (47 loc) · 1.02 KB
/
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
# Go parameters
GOCMD=go
GOLINT=golint
GOBUILD=$(GOCMD) build
GOINSTALL=$(GOCMD) install
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
SKIP_DEP=false
# Docker parameters
DOCKERCMD=docker
TEST_IGNORE= ".git,vendor"
COV_OUT := profile.coverprofile
COV_REPORT := overalls.coverprofile
COV_HTML := coverage.html
LINT_LOG := lint.log
V ?= 0
ifeq ($(V),0)
ECHO_V = @
else
VERBOSITY_FLAG = -v
DEBUG_FLAG = -debug
endif
all: clean build test
.PHONY: build
build:
$(GOBUILD) -o ./bin/p2p -v ./main
.PHONY: fmt
fmt:
$(GOCMD) fmt ./...
.PHONY: lint
lint:
go list ./... | grep -v /vendor/ | grep -v /explorer/idl/ | xargs $(GOLINT)
.PHONY: test
test: fmt
$(GOTEST) -short ./...
.PHONY: clean
clean:
@echo "Cleaning..."
$(ECHO_V)rm -f ./bin/p2p
$(ECHO_V)rm -f $(COV_REPORT) $(COV_HTML) $(LINT_LOG)
$(ECHO_V)find . -name $(COV_OUT) -delete
$(ECHO_V)find . -name $(TESTBED_COV_OUT) -delete
$(ECHO_V)$(GOCLEAN) -i $(PKGS)
.PHONY: docker
docker:
$(DOCKERCMD) build -t $(USER)/go-p2p:latest --build-arg SKIP_DEP=$(SKIP_DEP) .