2018-02-08 23:05:32 -08:00
|
|
|
PACKAGES=$(shell go list ./... | grep -v '/vendor/')
|
2018-01-16 11:23:32 -08:00
|
|
|
BUILD_FLAGS = -ldflags "-X github.com/cosmos/cosmos-sdk/version.GitCommit=`git rev-parse --short HEAD`"
|
2016-02-05 23:16:33 -08:00
|
|
|
|
2018-02-08 23:05:32 -08:00
|
|
|
all: check_tools get_vendor_deps build test
|
2017-10-23 13:22:30 -07:00
|
|
|
|
2018-01-17 17:00:48 -08:00
|
|
|
########################################
|
|
|
|
### CI
|
|
|
|
|
|
|
|
ci: get_tools get_vendor_deps build test_cover
|
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
########################################
|
|
|
|
### Build
|
2017-08-30 11:22:17 -07:00
|
|
|
|
2018-01-18 03:19:41 -08:00
|
|
|
# This can be unified later, here for easy demos
|
2018-02-07 08:33:28 -08:00
|
|
|
gaia:
|
2018-02-13 05:39:28 -08:00
|
|
|
go build $(BUILD_FLAGS) -o build/gaiad ./examples/gaia/gaiad
|
|
|
|
go build $(BUILD_FLAGS) -o build/gaiacli ./examples/gaia/gaiacli
|
2018-01-18 03:19:41 -08:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
build:
|
2018-01-20 22:08:06 -08:00
|
|
|
@rm -rf examples/basecoin/vendor/
|
2018-02-20 04:00:48 -08:00
|
|
|
cd examples/basecoin && $(MAKE) get_vendor_deps
|
2018-02-18 22:09:10 -08:00
|
|
|
go build $(BUILD_FLAGS) -o build/basecoind ./examples/basecoin/cmd/basecoind/...
|
2017-08-17 15:40:28 -07:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
dist:
|
|
|
|
@bash publish/dist.sh
|
|
|
|
@bash publish/publish.sh
|
2017-01-28 09:29:32 -08:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
########################################
|
|
|
|
### Tools & dependencies
|
2017-08-30 11:42:24 -07:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
check_tools:
|
|
|
|
cd tools && $(MAKE) check
|
2016-02-05 23:16:33 -08:00
|
|
|
|
2018-02-03 03:32:13 -08:00
|
|
|
update_tools:
|
|
|
|
cd tools && $(MAKE) glide_update
|
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
get_tools:
|
|
|
|
cd tools && $(MAKE)
|
|
|
|
|
|
|
|
get_vendor_deps:
|
|
|
|
@rm -rf vendor/
|
|
|
|
@echo "--> Running glide install"
|
|
|
|
@glide install
|
|
|
|
|
|
|
|
draw_deps:
|
|
|
|
@# requires brew install graphviz or apt-get install graphviz
|
|
|
|
go get github.com/RobotsAndPencils/goviz
|
|
|
|
@goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
|
2017-06-01 20:51:35 -07:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
|
2018-01-20 15:03:35 -08:00
|
|
|
########################################
|
|
|
|
### Documentation
|
|
|
|
|
|
|
|
godocs:
|
|
|
|
@echo "--> Wait a few seconds and visit http://localhost:6060/pkg/github.com/cosmos/cosmos-sdk/types"
|
|
|
|
godoc -http=:6060
|
|
|
|
|
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
########################################
|
|
|
|
### Testing
|
|
|
|
|
2018-01-06 12:53:31 -08:00
|
|
|
test: test_unit # test_cli
|
2017-06-15 08:16:00 -07:00
|
|
|
|
2017-06-15 12:11:47 -07:00
|
|
|
test_unit:
|
2018-01-26 04:19:33 -08:00
|
|
|
@rm -rf examples/basecoin/vendor/
|
2018-01-16 11:23:32 -08:00
|
|
|
@go test $(PACKAGES)
|
2017-01-11 21:07:56 -08:00
|
|
|
|
2018-01-17 17:00:48 -08:00
|
|
|
test_cover:
|
2018-02-02 14:15:01 -08:00
|
|
|
@bash tests/test_cover.sh
|
2018-01-17 17:00:48 -08:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
benchmark:
|
|
|
|
@go test -bench=. $(PACKAGES)
|
2017-01-28 09:29:32 -08:00
|
|
|
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
########################################
|
|
|
|
### Devdoc
|
|
|
|
|
|
|
|
DEVDOC_SAVE = docker commit `docker ps -a -n 1 -q` devdoc:local
|
|
|
|
|
|
|
|
devdoc_init:
|
|
|
|
docker run -it -v "$(CURDIR):/go/src/github.com/cosmos/cosmos-sdk" -w "/go/src/github.com/cosmos/cosmos-sdk" tendermint/devdoc echo
|
|
|
|
# TODO make this safer
|
|
|
|
$(call DEVDOC_SAVE)
|
|
|
|
|
|
|
|
devdoc:
|
|
|
|
docker run -it -v "$(CURDIR):/go/src/github.com/cosmos/cosmos-sdk" -w "/go/src/github.com/cosmos/cosmos-sdk" devdoc:local bash
|
|
|
|
|
|
|
|
devdoc_save:
|
|
|
|
# TODO make this safer
|
|
|
|
$(call DEVDOC_SAVE)
|
|
|
|
|
|
|
|
devdoc_clean:
|
|
|
|
docker rmi -f $$(docker images -f "dangling=true" -q)
|
2017-06-02 09:06:48 -07:00
|
|
|
|
2018-01-16 11:23:32 -08:00
|
|
|
devdoc_update:
|
|
|
|
docker pull tendermint/devdoc
|
2017-03-14 00:25:42 -07:00
|
|
|
|
2017-06-19 05:16:38 -07:00
|
|
|
|
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
|
|
|
|
.PHONY: build dist check_tools get_tools get_vendor_deps draw_deps test test_unit test_tutorial benchmark devdoc_init devdoc devdoc_save devdoc_update
|