2018-06-22 13:08:50 -07:00
|
|
|
all: get_tools
|
2018-01-16 11:23:32 -08:00
|
|
|
|
|
|
|
|
|
|
|
########################################
|
2018-02-25 10:12:15 -08:00
|
|
|
### DEP
|
2018-01-16 11:23:32 -08:00
|
|
|
|
2018-02-25 06:30:24 -08:00
|
|
|
DEP = github.com/golang/dep/cmd/dep
|
2018-06-22 11:01:44 -07:00
|
|
|
GOLINT = github.com/tendermint/lint/golint
|
2018-06-22 13:08:50 -07:00
|
|
|
GOMETALINTER = gopkg.in/alecthomas/gometalinter.v2
|
2018-06-28 09:08:29 -07:00
|
|
|
UNCONVERT = github.com/mdempsky/unconvert
|
2018-06-28 10:12:02 -07:00
|
|
|
INEFFASSIGN = github.com/gordonklaus/ineffassign
|
|
|
|
MISSPELL = github.com/client9/misspell/cmd/misspell
|
2018-06-28 09:08:29 -07:00
|
|
|
|
2018-02-25 06:30:24 -08:00
|
|
|
DEP_CHECK := $(shell command -v dep 2> /dev/null)
|
2018-06-22 11:01:44 -07:00
|
|
|
GOLINT_CHECK := $(shell command -v golint 2> /dev/null)
|
2018-06-22 13:08:50 -07:00
|
|
|
GOMETALINTER_CHECK := $(shell command -v gometalinter.v2 2> /dev/null)
|
2018-06-28 09:08:29 -07:00
|
|
|
UNCONVERT_CHECK := $(shell command -v unconvert 2> /dev/null)
|
2018-06-28 10:12:02 -07:00
|
|
|
INEFFASSIGN_CHECK := $(shell command -v ineffassign 2> /dev/null)
|
|
|
|
MISSPELL_CHECK := $(shell command -v misspell 2> /dev/null)
|
2018-01-16 11:23:32 -08:00
|
|
|
|
2018-03-02 03:15:47 -08:00
|
|
|
check_tools:
|
2018-02-25 06:30:24 -08:00
|
|
|
ifndef DEP_CHECK
|
2018-03-02 03:15:47 -08:00
|
|
|
@echo "No dep in path. Install with 'make get_tools'."
|
2018-01-16 11:23:32 -08:00
|
|
|
else
|
2018-02-25 06:30:24 -08:00
|
|
|
@echo "Found dep in path."
|
2018-01-16 11:23:32 -08:00
|
|
|
endif
|
2018-06-22 11:01:44 -07:00
|
|
|
ifndef GOLINT_CHECK
|
|
|
|
@echo "No golint in path. Install with 'make get_tools'."
|
|
|
|
else
|
|
|
|
@echo "Found golint in path."
|
|
|
|
endif
|
|
|
|
ifndef GOMETALINTER_CHECK
|
|
|
|
@echo "No gometalinter in path. Install with 'make get_tools'."
|
|
|
|
else
|
|
|
|
@echo "Found gometalinter in path."
|
|
|
|
endif
|
2018-06-28 09:08:29 -07:00
|
|
|
ifndef UNCONVERT_CHECK
|
|
|
|
@echo "No unconvert in path. Install with 'make get_tools'."
|
|
|
|
else
|
|
|
|
@echo "Found unconvert in path."
|
|
|
|
endif
|
2018-06-28 10:12:02 -07:00
|
|
|
ifndef INEFFASSIGN_CHECK
|
|
|
|
@echo "No ineffassign in path. Install with 'make get_tools'."
|
|
|
|
else
|
|
|
|
@echo "Found ineffassign in path."
|
|
|
|
endif
|
|
|
|
ifndef MISSPELL_CHECK
|
|
|
|
@echo "No misspell in path. Install with 'make get_tools'."
|
|
|
|
else
|
|
|
|
@echo "Found misspell in path."
|
|
|
|
endif
|
2018-01-16 11:23:32 -08:00
|
|
|
|
2018-03-03 18:09:59 -08:00
|
|
|
get_tools:
|
2018-02-25 06:30:24 -08:00
|
|
|
ifdef DEP_CHECK
|
2018-03-02 03:15:47 -08:00
|
|
|
@echo "Dep is already installed. Run 'make update_tools' to update."
|
2018-01-16 11:23:32 -08:00
|
|
|
else
|
2018-06-22 11:01:44 -07:00
|
|
|
@echo "Installing dep"
|
2018-02-25 06:30:24 -08:00
|
|
|
go get -v $(DEP)
|
2018-01-16 11:23:32 -08:00
|
|
|
endif
|
2018-06-22 11:01:44 -07:00
|
|
|
ifdef GOLINT_CHECK
|
|
|
|
@echo "Golint is already installed. Run 'make update_tools' to update."
|
|
|
|
else
|
|
|
|
@echo "Installing golint"
|
|
|
|
go get -v $(GOLINT)
|
|
|
|
endif
|
|
|
|
ifdef GOMETALINTER_CHECK
|
2018-06-22 13:08:50 -07:00
|
|
|
@echo "Gometalinter.v2 is already installed. Run 'make update_tools' to update."
|
2018-06-22 11:01:44 -07:00
|
|
|
else
|
2018-06-22 13:08:50 -07:00
|
|
|
@echo "Installing gometalinter.v2"
|
2018-06-22 11:01:44 -07:00
|
|
|
go get -v $(GOMETALINTER)
|
|
|
|
endif
|
2018-06-28 09:08:29 -07:00
|
|
|
ifdef UNCONVERT_CHECK
|
|
|
|
@echo "Unconvert is already installed. Run 'make update_tools' to update."
|
|
|
|
else
|
|
|
|
@echo "Installing unconvert"
|
|
|
|
go get -v $(UNCONVERT)
|
|
|
|
endif
|
2018-06-28 10:12:02 -07:00
|
|
|
ifdef INEFFASSIGN_CHECK
|
|
|
|
@echo "Ineffassign is already installed. Run 'make update_tools' to update."
|
|
|
|
else
|
|
|
|
@echo "Installing ineffassign"
|
|
|
|
go get -v $(INEFFASSIGN)
|
|
|
|
endif
|
|
|
|
ifdef MISSPELL_CHECK
|
|
|
|
@echo "misspell is already installed. Run 'make update_tools' to update."
|
|
|
|
else
|
|
|
|
@echo "Installing misspell"
|
|
|
|
go get -v $(MISSPELL)
|
|
|
|
endif
|
2018-01-16 11:23:32 -08:00
|
|
|
|
2018-03-02 03:15:47 -08:00
|
|
|
update_tools:
|
2018-06-22 11:01:44 -07:00
|
|
|
@echo "Updating dep"
|
2018-02-25 06:30:24 -08:00
|
|
|
go get -u -v $(DEP)
|
2018-06-22 11:01:44 -07:00
|
|
|
@echo "Updating tendermint/golint"
|
|
|
|
go get -u -v $(GOLINT)
|
2018-06-22 13:08:50 -07:00
|
|
|
@echo "Updating gometalinter.v2"
|
2018-06-22 11:01:44 -07:00
|
|
|
go get -u -v $(GOMETALINTER)
|
2018-06-28 09:08:29 -07:00
|
|
|
@echo "Updating unconvert"
|
|
|
|
go get -u -v $(UNCONVERT)
|
2018-06-28 10:12:02 -07:00
|
|
|
@echo "Updating ineffassign"
|
|
|
|
go get -u -v $(INEFFASSIGN)
|
|
|
|
@echo "Updating misspell"
|
|
|
|
go get -u -v $(MISSPELL)
|
2018-01-16 11:23:32 -08:00
|
|
|
|
|
|
|
# To avoid unintended conflicts with file names, always add to .PHONY
|
|
|
|
# unless there is a reason not to.
|
|
|
|
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
|
2018-06-22 13:08:50 -07:00
|
|
|
.PHONY: check_tools get_tools update_tools
|