Skip to content

Commit

Permalink
Merge PR #2744: Fix Makefile targets dependencies
Browse files Browse the repository at this point in the history
* Fix Makefile targets dependencies
* Remove unnecessary build deps from install targets
* Create a rule for each tool
* Don't dep test_lint on tools
  • Loading branch information
alessio authored and cwgoes committed Nov 14, 2018
1 parent d1614eb commit 6e9c3f8
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ GOTOOLS = \
github.com/golang/dep/cmd/dep \
github.com/alecthomas/gometalinter \
github.com/rakyll/statik
GOBIN ?= $(GOPATH)/bin
all: get_tools get_vendor_deps install install_examples install_cosmos-sdk-cli test_lint test

########################################
Expand Down Expand Up @@ -113,26 +114,29 @@ update_dev_tools:
$(GOPATH)/src/github.com/alecthomas/gometalinter/scripts/install.sh -b $(GOBIN)
go get -u github.com/tendermint/lint/golint

get_tools:
get_tools: $(GOBIN)/dep $(GOBIN)/gometalinter $(GOBIN)/statik
@echo "--> Installing tools"
$(MAKE) -C scripts get_tools

get_dev_tools:
$(GOBIN)/%:
$(MAKE) -C scripts $(subst $(GOBIN)/,,$(@))

get_dev_tools: get_tools
@echo "--> Downloading linters (this may take awhile)"
$(GOPATH)/src/github.com/alecthomas/gometalinter/scripts/install.sh -b $(GOBIN)
go get github.com/tendermint/lint/golint

get_vendor_deps:
get_vendor_deps: get_tools
@echo "--> Generating vendor directory via dep ensure"
@rm -rf .vendor-new
@dep ensure -v -vendor-only

update_vendor_deps:
update_vendor_deps: get_tools
@echo "--> Running dep ensure"
@rm -rf .vendor-new
@dep ensure -v

draw_deps:
draw_deps: get_tools
@# requires brew install graphviz or apt-get install graphviz
go get github.com/RobotsAndPencils/goviz
@goviz -i github.com/cosmos/cosmos-sdk/cmd/gaia/cmd/gaiad -d 2 | dot -Tpng -o dependency-graph.png
Expand Down Expand Up @@ -261,7 +265,7 @@ localnet-stop:
# unless there is a reason not to.
# https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
.PHONY: build build_cosmos-sdk-cli build_examples install install_examples install_cosmos-sdk-cli install_debug dist \
check_tools check_dev_tools get_tools get_dev_tools get_vendor_deps draw_deps test test_cli test_unit \
check_tools check_dev_tools get_dev_tools get_vendor_deps draw_deps test test_cli test_unit \
test_cover test_lint benchmark devdoc_init devdoc devdoc_save devdoc_update \
build-linux build-docker-gaiadnode localnet-start localnet-stop \
format check-ledger test_sim_gaia_nondeterminism test_sim_modules test_sim_gaia_fast \
Expand Down

0 comments on commit 6e9c3f8

Please sign in to comment.