cosmos-sdk/Makefile

77 lines
2.1 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
2017-10-23 13:22:30 -07:00
# EXAMPLES := counter eyes basecoin
EXAMPLES := eyes
INSTALL_EXAMPLES := $(addprefix install_,${EXAMPLES})
TEST_EXAMPLES := $(addprefix testex_,${EXAMPLES})
2017-08-30 11:22:17 -07:00
2017-08-21 14:21:42 -07:00
LINKER_FLAGS:="-X github.com/cosmos/cosmos-sdk/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_EXAMPLES): install_%:
cd ./examples/$* && make install
$(TEST_EXAMPLES): testex_%:
cd ./examples/$* && make test_cli
install: $(INSTALL_EXAMPLES)
@go install -ldflags $(LINKER_FLAGS) ./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:
@go test `glide novendor | grep -v _attic | grep -v examples`
2016-02-05 23:16:33 -08:00
test_cli: $(TEST_EXAMPLES)
2017-06-15 12:11:47 -07:00
# sudo apt-get install jq
# wget "https://raw.githubusercontent.com/kward/shunit2/master/source/2.1/src/shunit2"
2017-01-11 21:07:56 -08:00
test_tutorial:
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-12-01 14:08:37 -08:00
test_store:
@go test store/*.go
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
2017-12-01 14:08:37 -08:00
.PHONY: all build install test test_cli test_unit test_store get_vendor_deps build-docker clean fresh benchmark