Makefile 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  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 android ios geth-cross swarm evm all test clean
  5. .PHONY: geth-linux geth-linux-386 geth-linux-amd64 geth-linux-mips64 geth-linux-mips64le
  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. GOBIN = $(pwd)/build/bin
  10. GO ?= latest
  11. geth:
  12. build/env.sh go run build/ci.go install ./cmd/geth
  13. @echo "Done building."
  14. @echo "Run \"$(GOBIN)/geth\" to launch geth."
  15. swarm:
  16. build/env.sh go run build/ci.go install ./cmd/swarm
  17. @echo "Done building."
  18. @echo "Run \"$(GOBIN)/swarm\" to launch swarm."
  19. evm:
  20. build/env.sh go run build/ci.go install ./cmd/evm
  21. @echo "Done building."
  22. @echo "Run \"$(GOBIN)/evm\" to start the evm."
  23. all:
  24. build/env.sh go run build/ci.go install
  25. android:
  26. build/env.sh go run build/ci.go aar --local
  27. @echo "Done building."
  28. @echo "Import \"$(GOBIN)/geth.aar\" to use the library."
  29. ios:
  30. build/env.sh go run build/ci.go xcode --local
  31. @echo "Done building."
  32. @echo "Import \"$(GOBIN)/Geth.framework\" to use the library."
  33. test: all
  34. build/env.sh go run build/ci.go test
  35. clean:
  36. rm -fr build/_workspace/pkg/ $(GOBIN)/*
  37. # The devtools target installs tools required for 'go generate'.
  38. # You need to put $GOBIN (or $GOPATH/bin) in your PATH to use 'go generate'.
  39. devtools:
  40. env GOBIN= go get -u golang.org/x/tools/cmd/stringer
  41. env GOBIN= go get -u github.com/jteeuwen/go-bindata/go-bindata
  42. env GOBIN= go get -u github.com/fjl/gencodec
  43. env GOBIN= go install ./cmd/abigen
  44. # Cross Compilation Targets (xgo)
  45. geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
  46. @echo "Full cross compilation done:"
  47. @ls -ld $(GOBIN)/geth-*
  48. geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm geth-linux-mips64 geth-linux-mips64le
  49. @echo "Linux cross compilation done:"
  50. @ls -ld $(GOBIN)/geth-linux-*
  51. geth-linux-386:
  52. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/386 -v ./cmd/geth
  53. @echo "Linux 386 cross compilation done:"
  54. @ls -ld $(GOBIN)/geth-linux-* | grep 386
  55. geth-linux-amd64:
  56. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/amd64 -v ./cmd/geth
  57. @echo "Linux amd64 cross compilation done:"
  58. @ls -ld $(GOBIN)/geth-linux-* | grep amd64
  59. geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
  60. @echo "Linux ARM cross compilation done:"
  61. @ls -ld $(GOBIN)/geth-linux-* | grep arm
  62. geth-linux-arm-5:
  63. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-5 -v ./cmd/geth
  64. @echo "Linux ARMv5 cross compilation done:"
  65. @ls -ld $(GOBIN)/geth-linux-* | grep arm-5
  66. geth-linux-arm-6:
  67. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-6 -v ./cmd/geth
  68. @echo "Linux ARMv6 cross compilation done:"
  69. @ls -ld $(GOBIN)/geth-linux-* | grep arm-6
  70. geth-linux-arm-7:
  71. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm-7 -v ./cmd/geth
  72. @echo "Linux ARMv7 cross compilation done:"
  73. @ls -ld $(GOBIN)/geth-linux-* | grep arm-7
  74. geth-linux-arm64:
  75. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/arm64 -v ./cmd/geth
  76. @echo "Linux ARM64 cross compilation done:"
  77. @ls -ld $(GOBIN)/geth-linux-* | grep arm64
  78. geth-linux-mips:
  79. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips --ldflags '-extldflags "-static"' -v ./cmd/geth
  80. @echo "Linux MIPS cross compilation done:"
  81. @ls -ld $(GOBIN)/geth-linux-* | grep mips
  82. geth-linux-mipsle:
  83. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mipsle --ldflags '-extldflags "-static"' -v ./cmd/geth
  84. @echo "Linux MIPSle cross compilation done:"
  85. @ls -ld $(GOBIN)/geth-linux-* | grep mipsle
  86. geth-linux-mips64:
  87. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64 --ldflags '-extldflags "-static"' -v ./cmd/geth
  88. @echo "Linux MIPS64 cross compilation done:"
  89. @ls -ld $(GOBIN)/geth-linux-* | grep mips64
  90. geth-linux-mips64le:
  91. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=linux/mips64le --ldflags '-extldflags "-static"' -v ./cmd/geth
  92. @echo "Linux MIPS64le cross compilation done:"
  93. @ls -ld $(GOBIN)/geth-linux-* | grep mips64le
  94. geth-darwin: geth-darwin-386 geth-darwin-amd64
  95. @echo "Darwin cross compilation done:"
  96. @ls -ld $(GOBIN)/geth-darwin-*
  97. geth-darwin-386:
  98. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/386 -v ./cmd/geth
  99. @echo "Darwin 386 cross compilation done:"
  100. @ls -ld $(GOBIN)/geth-darwin-* | grep 386
  101. geth-darwin-amd64:
  102. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=darwin/amd64 -v ./cmd/geth
  103. @echo "Darwin amd64 cross compilation done:"
  104. @ls -ld $(GOBIN)/geth-darwin-* | grep amd64
  105. geth-windows: geth-windows-386 geth-windows-amd64
  106. @echo "Windows cross compilation done:"
  107. @ls -ld $(GOBIN)/geth-windows-*
  108. geth-windows-386:
  109. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/386 -v ./cmd/geth
  110. @echo "Windows 386 cross compilation done:"
  111. @ls -ld $(GOBIN)/geth-windows-* | grep 386
  112. geth-windows-amd64:
  113. build/env.sh go run build/ci.go xgo -- --go=$(GO) --targets=windows/amd64 -v ./cmd/geth
  114. @echo "Windows amd64 cross compilation done:"
  115. @ls -ld $(GOBIN)/geth-windows-* | grep amd64