Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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 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 = 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. evm:
  16. build/env.sh go run build/ci.go install ./cmd/evm
  17. @echo "Done building."
  18. @echo "Run \"$(GOBIN)/evm\" to start the evm."
  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. clean:
  32. rm -fr build/_workspace/pkg/ $(GOBIN)/*
  33. # Cross Compilation Targets (xgo)
  34. geth-cross: geth-linux geth-darwin geth-windows geth-android geth-ios
  35. @echo "Full cross compilation done:"
  36. @ls -ld $(GOBIN)/geth-*
  37. geth-linux: geth-linux-386 geth-linux-amd64 geth-linux-arm geth-linux-mips64 geth-linux-mips64le
  38. @echo "Linux cross compilation done:"
  39. @ls -ld $(GOBIN)/geth-linux-*
  40. geth-linux-386:
  41. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/386 -v ./cmd/geth
  42. @echo "Linux 386 cross compilation done:"
  43. @ls -ld $(GOBIN)/geth-linux-* | grep 386
  44. geth-linux-amd64:
  45. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/amd64 -v ./cmd/geth
  46. @echo "Linux amd64 cross compilation done:"
  47. @ls -ld $(GOBIN)/geth-linux-* | grep amd64
  48. geth-linux-arm: geth-linux-arm-5 geth-linux-arm-6 geth-linux-arm-7 geth-linux-arm64
  49. @echo "Linux ARM cross compilation done:"
  50. @ls -ld $(GOBIN)/geth-linux-* | grep arm
  51. geth-linux-arm-5:
  52. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-5 -v ./cmd/geth
  53. @echo "Linux ARMv5 cross compilation done:"
  54. @ls -ld $(GOBIN)/geth-linux-* | grep arm-5
  55. geth-linux-arm-6:
  56. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-6 -v ./cmd/geth
  57. @echo "Linux ARMv6 cross compilation done:"
  58. @ls -ld $(GOBIN)/geth-linux-* | grep arm-6
  59. geth-linux-arm-7:
  60. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/arm-7 -v ./cmd/geth
  61. @echo "Linux ARMv7 cross compilation done:"
  62. @ls -ld $(GOBIN)/geth-linux-* | grep arm-7
  63. geth-linux-arm64:
  64. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/arm64 -v ./cmd/geth
  65. @echo "Linux ARM64 cross compilation done:"
  66. @ls -ld $(GOBIN)/geth-linux-* | grep arm64
  67. geth-linux-mips64:
  68. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/mips64 -v ./cmd/geth
  69. @echo "Linux MIPS64 cross compilation done:"
  70. @ls -ld $(GOBIN)/geth-linux-* | grep mips64
  71. geth-linux-mips64le:
  72. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=linux/mips64le -v ./cmd/geth
  73. @echo "Linux MIPS64le cross compilation done:"
  74. @ls -ld $(GOBIN)/geth-linux-* | grep mips64le
  75. geth-darwin: geth-darwin-386 geth-darwin-amd64
  76. @echo "Darwin cross compilation done:"
  77. @ls -ld $(GOBIN)/geth-darwin-*
  78. geth-darwin-386:
  79. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=darwin/386 -v ./cmd/geth
  80. @echo "Darwin 386 cross compilation done:"
  81. @ls -ld $(GOBIN)/geth-darwin-* | grep 386
  82. geth-darwin-amd64:
  83. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=darwin/amd64 -v ./cmd/geth
  84. @echo "Darwin amd64 cross compilation done:"
  85. @ls -ld $(GOBIN)/geth-darwin-* | grep amd64
  86. geth-windows: geth-windows-386 geth-windows-amd64
  87. @echo "Windows cross compilation done:"
  88. @ls -ld $(GOBIN)/geth-windows-*
  89. geth-windows-386:
  90. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=windows/386 -v ./cmd/geth
  91. @echo "Windows 386 cross compilation done:"
  92. @ls -ld $(GOBIN)/geth-windows-* | grep 386
  93. geth-windows-amd64:
  94. build/env.sh go run build/ci.go xgo -- --go=$(GO) --dest=$(GOBIN) --targets=windows/amd64 -v ./cmd/geth
  95. @echo "Windows amd64 cross compilation done:"
  96. @ls -ld $(GOBIN)/geth-windows-* | grep amd64