Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # This Makefile is meant to be used by people that do not usually work
  2. # with Go source code. If you know what GOPATH is then you probably
  3. # don't need to bother with make.
  4. .PHONY: geth geth-cross evm all test travis-test-with-coverage xgo clean
  5. .PHONY: geth-linux geth-linux-386 geth-linux-amd64
  6. .PHONY: geth-linux-arm geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
  7. .PHONY: geth-darwin geth-darwin-386 geth-darwin-amd64
  8. .PHONY: geth-windows geth-windows-386 geth-windows-amd64
  9. .PHONY: geth-android geth-ios
  10. GOBIN = build/bin
  11. GO ?= latest
  12. geth:
  13. build/env.sh go install -v $(shell build/flags.sh) ./cmd/geth
  14. @echo "Done building."
  15. @echo "Run \"$(GOBIN)/geth\" to launch geth."
  16. geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
  17. @echo "Full cross compilation done:"
  18. @ls -ld $(GOBIN)/geth-*
  19. geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm
  20. @echo "Linux cross compilation done:"
  21. @ls -ld $(GOBIN)/geth-linux-*
  22. geth-linux-386: xgo
  23. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth
  24. @echo "Linux 386 cross compilation done:"
  25. @ls -ld $(GOBIN)/geth-linux-* | grep 386
  26. geth-linux-amd64: xgo
  27. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth
  28. @echo "Linux amd64 cross compilation done:"
  29. @ls -ld $(GOBIN)/geth-linux-* | grep amd64
  30. geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
  31. @echo "Linux ARM cross compilation done:"
  32. @ls -ld $(GOBIN)/geth-linux-* | grep arm
  33. geth-linux-arm-5: xgo
  34. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-5 -v $(shell build/flags.sh) ./cmd/geth
  35. @echo "Linux ARMv5 cross compilation done:"
  36. @ls -ld $(GOBIN)/geth-linux-* | grep arm-5
  37. geth-linux-arm-6: xgo
  38. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-6 -v $(shell build/flags.sh) ./cmd/geth
  39. @echo "Linux ARMv6 cross compilation done:"
  40. @ls -ld $(GOBIN)/geth-linux-* | grep arm-6
  41. geth-linux-arm-7: xgo
  42. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-7 -v $(shell build/flags.sh) ./cmd/geth
  43. @echo "Linux ARMv7 cross compilation done:"
  44. @ls -ld $(GOBIN)/geth-linux-* | grep arm-7
  45. geth-linux-arm64: xgo
  46. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm64 -v $(shell build/flags.sh) ./cmd/geth
  47. @echo "Linux ARM64 cross compilation done:"
  48. @ls -ld $(GOBIN)/geth-linux-* | grep arm64
  49. geth-darwin: geth-darwin-386 geth-darwin-amd64
  50. @echo "Darwin cross compilation done:"
  51. @ls -ld $(GOBIN)/geth-darwin-*
  52. geth-darwin-386: xgo
  53. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth
  54. @echo "Darwin 386 cross compilation done:"
  55. @ls -ld $(GOBIN)/geth-darwin-* | grep 386
  56. geth-darwin-amd64: xgo
  57. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth
  58. @echo "Darwin amd64 cross compilation done:"
  59. @ls -ld $(GOBIN)/geth-darwin-* | grep amd64
  60. geth-windows: geth-windows-386 geth-windows-amd64
  61. @echo "Windows cross compilation done:"
  62. @ls -ld $(GOBIN)/geth-windows-*
  63. geth-windows-386: xgo
  64. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth
  65. @echo "Windows 386 cross compilation done:"
  66. @ls -ld $(GOBIN)/geth-windows-* | grep 386
  67. geth-windows-amd64: xgo
  68. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth
  69. @echo "Windows amd64 cross compilation done:"
  70. @ls -ld $(GOBIN)/geth-windows-* | grep amd64
  71. geth-android: xgo
  72. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=android-21/aar -v $(shell build/flags.sh) ./cmd/geth
  73. @echo "Android cross compilation done:"
  74. @ls -ld $(GOBIN)/geth-android-*
  75. geth-ios: xgo
  76. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=ios-7.0/framework -v $(shell build/flags.sh) ./cmd/geth
  77. @echo "iOS framework cross compilation done:"
  78. @ls -ld $(GOBIN)/geth-ios-*
  79. evm:
  80. build/env.sh $(GOROOT)/bin/go install -v $(shell build/flags.sh) ./cmd/evm
  81. @echo "Done building."
  82. @echo "Run \"$(GOBIN)/evm to start the evm."
  83. all:
  84. build/env.sh go install -v $(shell build/flags.sh) ./...
  85. test: all
  86. build/env.sh go test ./...
  87. travis-test-with-coverage: all
  88. build/env.sh go vet ./...
  89. build/env.sh build/test-global-coverage.sh
  90. xgo:
  91. build/env.sh go get github.com/karalabe/xgo
  92. clean:
  93. rm -fr build/_workspace/pkg/ Godeps/_workspace/pkg $(GOBIN)/*