2 github.com/mitchellh/gox \
3 github.com/Masterminds/glide
4 PACKAGES=$(shell go list ./... | grep -v '/vendor/')
6 TMHOME = $${TMHOME:-$$HOME/.bytom}
10 install: get_vendor_deps copy
11 @go install --ldflags '-extldflags "-static"' \
12 --ldflags "-X github.com/Bytom/blockchain/version.GitCommit=`git rev-parse HEAD`" ./node/
16 --ldflags "-X github.com/Bytom/blockchain/version.GitCommit=`git rev-parse HEAD`" -o build/node ./node/
19 cp -r vendor/github.com/golang/crypto vendor/golang.org/x/crypto
20 cp -r vendor/github.com/golang/net vendor/golang.org/x/net
21 cp -r vendor/github.com/golang/text vendor/golang.org/x/text
22 cp -r vendor/github.com/golang/tools vendor/golang.org/x/tools
24 # dist builds binaries for all platforms and packages them for distribution
26 @BUILD_TAGS='$(BUILD_TAGS)' sh -c "'$(CURDIR)/scripts/dist.sh'"
29 @echo "--> Running go test"
33 @echo "--> Running go test --race"
34 @go test -v -race $(PACKAGES)
40 @for i in {1..100}; do make test; done
43 # requires brew install graphviz or apt-get install graphviz
44 go get github.com/RobotsAndPencils/goviz
45 @goviz -i github.com/tendermint/tendermint/cmd/tendermint -d 3 | dot -Tpng -o dependency-graph.png
48 @go list -f '{{join .Deps "\n"}}' ./... | \
49 grep -v /vendor/ | sort | uniq | \
50 xargs go list -f '{{if not .Standard}}{{.ImportPath}}{{end}}'
53 @echo "--> Running go get"
54 @go get -v -d $(PACKAGES)
55 @go list -f '{{join .TestImports "\n"}}' ./... | \
56 grep -v /vendor/ | sort | uniq | \
59 get_vendor_deps: ensure_tools
61 @echo "--> Running glide install"
65 @echo "--> Updating dependencies"
69 -echo `git rev-parse --verify HEAD` > $(TMHOME)/revision
70 -echo `git rev-parse --verify HEAD` >> $(TMHOME)/revision_history
73 go get -u -v $(GOTOOLS)
79 .PHONY: install build build_race dist test test_race test_integrations test100 draw_deps list_deps get_deps get_vendor_deps update_deps revision tools