OSDN Git Service

Merge pull request #49 from Bytom/dev
[bytom/bytom.git] / Makefile
1 GOTOOLS  = github.com/mitchellh/gox \
2                    github.com/Masterminds/glide
3 PACKAGES = $(shell go list ./... | grep -v '/vendor/' | grep -v '/rpc/')
4
5 all: install test
6
7 install: get_vendor_deps copy
8         @go install --ldflags '-extldflags "-static"' \
9                 --ldflags "-X github.com/Bytom/blockchain/version.GitCommit=`git rev-parse HEAD`" ./node/
10         @echo "====> Done!"
11
12 get_vendor_deps: ensure_tools
13         @rm -rf vendor/
14         @echo "====> Running glide install"
15         @glide install
16
17 ensure_tools:
18         go get $(GOTOOLS)
19
20 # In case of the terrible network condition
21 copy:
22         @cp -r vendor/github.com/golang/crypto vendor/golang.org/x/crypto
23         @cp -r vendor/github.com/golang/net    vendor/golang.org/x/net
24         @cp -r vendor/github.com/golang/text   vendor/golang.org/x/text
25         @cp -r vendor/github.com/golang/tools  vendor/golang.org/x/tools
26         @cp -r vendor/github.com/golang/time   vendor/golang.org/x/time
27
28 test:
29         @echo "=====> Running go test"
30         @go test $(PACKAGES)
31
32 .PHONY: install get_vendor_deps ensure_tools copy test