Makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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 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 run build/ci.go install ./cmd/geth
  14. @echo "Done building."
  15. @echo "Run \"$(GOBIN)/geth\" to launch geth."
  16. evm:
  17. build/env.sh go run build/ci.go install ./cmd/evm
  18. @echo "Done building."
  19. @echo "Run \"$(GOBIN)/evm to start the evm."
  20. all:
  21. build/env.sh go run build/ci.go install
  22. test: all
  23. build/env.sh go run build/ci.go test
  24. clean:
  25. rm -fr build/_workspace/pkg/ Godeps/_workspace/pkg $(GOBIN)/*
  26. # Cross Compilation Targets (xgo)
  27. xgo:
  28. build/env.sh go get github.com/karalabe/xgo
  29. geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
  30. @echo "Full cross compilation done:"
  31. @ls -ld $(GOBIN)/geth-*
  32. geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm
  33. @echo "Linux cross compilation done:"
  34. @ls -ld $(GOBIN)/geth-linux-*
  35. geth-linux-386: xgo
  36. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth
  37. @echo "Linux 386 cross compilation done:"
  38. @ls -ld $(GOBIN)/geth-linux-* | grep 386
  39. geth-linux-amd64: xgo
  40. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth
  41. @echo "Linux amd64 cross compilation done:"
  42. @ls -ld $(GOBIN)/geth-linux-* | grep amd64
  43. geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
  44. @echo "Linux ARM cross compilation done:"
  45. @ls -ld $(GOBIN)/geth-linux-* | grep arm
  46. geth-linux-arm-5: xgo
  47. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-5 -v $(shell build/flags.sh) ./cmd/geth
  48. @echo "Linux ARMv5 cross compilation done:"
  49. @ls -ld $(GOBIN)/geth-linux-* | grep arm-5
  50. geth-linux-arm-6: xgo
  51. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-6 -v $(shell build/flags.sh) ./cmd/geth
  52. @echo "Linux ARMv6 cross compilation done:"
  53. @ls -ld $(GOBIN)/geth-linux-* | grep arm-6
  54. geth-linux-arm-7: xgo
  55. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-7 -v $(shell build/flags.sh) ./cmd/geth
  56. @echo "Linux ARMv7 cross compilation done:"
  57. @ls -ld $(GOBIN)/geth-linux-* | grep arm-7
  58. geth-linux-arm64: xgo
  59. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=linux/arm64 -v $(shell build/flags.sh) ./cmd/geth
  60. @echo "Linux ARM64 cross compilation done:"
  61. @ls -ld $(GOBIN)/geth-linux-* | grep arm64
  62. geth-darwin: geth-darwin-386 geth-darwin-amd64
  63. @echo "Darwin cross compilation done:"
  64. @ls -ld $(GOBIN)/geth-darwin-*
  65. geth-darwin-386: xgo
  66. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth
  67. @echo "Darwin 386 cross compilation done:"
  68. @ls -ld $(GOBIN)/geth-darwin-* | grep 386
  69. geth-darwin-amd64: xgo
  70. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth
  71. @echo "Darwin amd64 cross compilation done:"
  72. @ls -ld $(GOBIN)/geth-darwin-* | grep amd64
  73. geth-windows: geth-windows-386 geth-windows-amd64
  74. @echo "Windows cross compilation done:"
  75. @ls -ld $(GOBIN)/geth-windows-*
  76. geth-windows-386: xgo
  77. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth
  78. @echo "Windows 386 cross compilation done:"
  79. @ls -ld $(GOBIN)/geth-windows-* | grep 386
  80. geth-windows-amd64: xgo
  81. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth
  82. @echo "Windows amd64 cross compilation done:"
  83. @ls -ld $(GOBIN)/geth-windows-* | grep amd64
  84. geth-android: xgo
  85. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=android-21/aar -v $(shell build/flags.sh) ./cmd/geth
  86. @echo "Android cross compilation done:"
  87. @ls -ld $(GOBIN)/geth-android-*
  88. geth-ios: xgo
  89. build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --targets=ios-7.0/framework -v $(shell build/flags.sh) ./cmd/geth
  90. @echo "iOS framework cross compilation done:"
  91. @ls -ld $(GOBIN)/geth-ios-*