Makefile 5.4 KB

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