Fix Makefile's all target (#3085)

- Rename get_dev_tools to devtools
- tools and devtools now create a stamp after execution so
  that they are not executed twice on the same pipeline
- Add clean target to remove stamps
This commit is contained in:
Alessio Treglia
2018-12-20 10:03:59 -08:00
committed by Jack Zampolin
parent 5a13e75367
commit 0c0bff7ea0
11 changed files with 41 additions and 25 deletions
+13 -9
View File
@@ -9,15 +9,15 @@ GOTOOLS = \
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
all: devtools get_vendor_deps install install_examples install_cosmos-sdk-cli test_lint test
# The below include contains the get_tools target.
# The below include contains the tools target.
include scripts/Makefile
########################################
### CI
ci: get_tools get_vendor_deps install test_cover test_lint test
ci: devtools get_vendor_deps install test_cover test_lint test
########################################
### Build/Install
@@ -117,33 +117,37 @@ check_tools:
update_tools:
@echo "--> Updating tools to correct version"
$(MAKE) --always-make get_tools
$(MAKE) --always-make tools
update_dev_tools:
@echo "--> Downloading linters (this may take awhile)"
$(GOPATH)/src/github.com/alecthomas/gometalinter/scripts/install.sh -b $(GOBIN)
go get -u github.com/tendermint/lint/golint
get_dev_tools: get_tools
devtools: devtools-stamp
devtools-stamp: 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
touch $@
get_vendor_deps: get_tools
get_vendor_deps: tools
@echo "--> Generating vendor directory via dep ensure"
@rm -rf .vendor-new
@dep ensure -v -vendor-only
update_vendor_deps: get_tools
update_vendor_deps: tools
@echo "--> Running dep ensure"
@rm -rf .vendor-new
@dep ensure -v
draw_deps: get_tools
draw_deps: 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
clean:
rm -f devtools-stamp
########################################
### Documentation
@@ -264,7 +268,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_dev_tools get_vendor_deps draw_deps test test_cli test_unit \
check_tools check_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 \