cosmos-sdk/Makefile

80 lines
2.2 KiB
Makefile
Raw Normal View History

2017-06-15 12:11:47 -07:00
GOTOOLS = github.com/mitchellh/gox \
2017-06-28 02:16:33 -07:00
github.com/Masterminds/glide \
github.com/rigelrozanski/shelldown/cmd/shelldown
TUTORIALS=$(shell find docs/guide -name "*md" -type f)
2016-02-05 23:16:33 -08:00
LINKER_FLAGS:="-X github.com/tendermint/basecoin/client/commands.CommitHash=`git rev-parse --short HEAD`"
2017-06-15 12:11:47 -07:00
all: get_vendor_deps install test
2017-01-28 09:29:32 -08:00
build:
2017-07-04 20:28:27 -07:00
@go build ./cmd/...
2017-01-28 09:29:32 -08:00
install:
@go install -ldflags $(LINKER_FLAGS) ./cmd/...
@go install -ldflags $(LINKER_FLAGS) ./docs/guide/counter/cmd/...
2016-02-05 23:16:33 -08:00
2017-06-01 20:51:35 -07:00
dist:
2017-07-04 20:28:27 -07:00
@bash publish/dist.sh
@bash publish/publish.sh
2017-06-01 20:51:35 -07:00
benchmark:
@go test -bench=. ./modules/...
2017-07-18 13:40:04 -07:00
#test: test_unit test_cli test_tutorial
test: test_unit test_cli
2017-06-15 08:16:00 -07:00
2017-06-15 12:11:47 -07:00
test_unit:
2017-07-04 20:28:27 -07:00
@go test `glide novendor`
#go run tests/tendermint/*.go
2016-02-05 23:16:33 -08:00
2017-06-29 05:52:38 -07:00
test_cli: tests/cli/shunit2
2017-06-15 12:11:47 -07:00
# sudo apt-get install jq
2017-07-18 12:46:13 -07:00
./tests/cli/keys.sh
./tests/cli/rpc.sh
./tests/cli/init.sh
./tests/cli/basictx.sh
./tests/cli/eyes.sh
2017-07-19 07:36:35 -07:00
./tests/cli/roles.sh
./tests/cli/counter.sh
./tests/cli/restart.sh
./tests/cli/ibc.sh
2017-01-11 21:07:56 -08:00
2017-06-29 05:52:38 -07:00
test_tutorial: docs/guide/shunit2
2017-07-04 20:28:27 -07:00
@shelldown ${TUTORIALS}
@for script in docs/guide/*.sh ; do \
2017-06-28 22:29:10 -07:00
bash $$script ; \
2017-06-28 02:16:33 -07:00
done
2017-06-29 05:52:38 -07:00
tests/cli/shunit2:
2017-07-04 20:28:27 -07:00
@wget "https://raw.githubusercontent.com/kward/shunit2/master/source/2.1/src/shunit2" \
2017-06-28 22:29:10 -07:00
-q -O tests/cli/shunit2
2017-06-29 05:52:38 -07:00
docs/guide/shunit2:
2017-07-04 20:28:27 -07:00
@wget "https://raw.githubusercontent.com/kward/shunit2/master/source/2.1/src/shunit2" \
2017-06-29 05:52:38 -07:00
-q -O docs/guide/shunit2
2017-06-28 22:29:10 -07:00
get_vendor_deps: tools
2017-07-04 20:28:27 -07:00
@glide install
2017-01-28 09:29:32 -08:00
build-docker:
2017-07-04 20:28:27 -07:00
@docker run -it --rm -v "$(PWD):/go/src/github.com/tendermint/basecoin" -w \
2017-06-15 12:11:47 -07:00
"/go/src/github.com/tendermint/basecoin" -e "CGO_ENABLED=0" golang:alpine go build ./cmd/basecoin
2017-07-04 20:28:27 -07:00
@docker build -t "tendermint/basecoin" .
tools:
@go get $(GOTOOLS)
clean:
# maybe cleaning up cache and vendor is overkill, but sometimes
# you don't get the most recent versions with lots of branches, changes, rebases...
@rm -rf ~/.glide/cache/src/https-github.com-tendermint-*
@rm -rf ./vendor
@rm -f $GOPATH/bin/{basecoin,basecli,counter,countercli}
# when your repo is getting a little stale... just make fresh
fresh: clean get_vendor_deps install
2017-08-08 12:09:39 -07:00
@if [ "$(git status -s)" ]; then echo; echo "Warning: uncommited changes"; git status -s; fi
.PHONY: all build install test test_cli test_unit get_vendor_deps build-docker clean fresh benchmark