Skip to content

Commit fea819f

Browse files
committed
Makefile: individual platforms, configurable Go runtime
1 parent f16fab9 commit fea819f

File tree

1 file changed

+58
-9
lines changed

1 file changed

+58
-9
lines changed

Makefile

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,17 @@
22
# with Go source code. If you know what GOPATH is then you probably
33
# don't need to bother with make.
44

5-
.PHONY: geth geth-cross geth-linux geth-darwin geth-windows geth-android evm all test travis-test-with-coverage xgo clean
5+
.PHONY: geth geth-cross evm all test travis-test-with-coverage xgo clean
6+
.PHONY: geth-linux geth-linux-arm geth-linux-386 geth-linux-amd64
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-android-16 geth-android-21
10+
611
GOBIN = build/bin
712

13+
CROSSDEPS = https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2
14+
GO ?= latest
15+
816
geth:
917
build/env.sh go install -v $(shell build/flags.sh) ./cmd/geth
1018
@echo "Done building."
@@ -14,26 +22,67 @@ geth-cross: geth-linux geth-darwin geth-windows geth-android
1422
@echo "Full cross compilation done:"
1523
@ls -l $(GOBIN)/geth-*
1624

17-
geth-linux: xgo
18-
build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=linux/* -v $(shell build/flags.sh) ./cmd/geth
25+
geth-linux: xgo geth-linux-arm geth-linux-386 geth-linux-amd64
1926
@echo "Linux cross compilation done:"
2027
@ls -l $(GOBIN)/geth-linux-*
2128

22-
geth-darwin: xgo
23-
build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=darwin/* -v $(shell build/flags.sh) ./cmd/geth
29+
geth-linux-arm: xgo
30+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/arm -v $(shell build/flags.sh) ./cmd/geth
31+
@echo "Linux ARM cross compilation done:"
32+
@ls -l $(GOBIN)/geth-linux-* | grep arm
33+
34+
geth-linux-386: xgo
35+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/386 -v $(shell build/flags.sh) ./cmd/geth
36+
@echo "Linux 386 cross compilation done:"
37+
@ls -l $(GOBIN)/geth-linux-* | grep 386
38+
39+
geth-linux-amd64: xgo
40+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=linux/amd64 -v $(shell build/flags.sh) ./cmd/geth
41+
@echo "Linux amd64 cross compilation done:"
42+
@ls -l $(GOBIN)/geth-linux-* | grep amd64
43+
44+
geth-darwin: xgo geth-darwin-386 geth-darwin-amd64
2445
@echo "Darwin cross compilation done:"
2546
@ls -l $(GOBIN)/geth-darwin-*
2647

27-
geth-windows: xgo
28-
build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=windows/* -v $(shell build/flags.sh) ./cmd/geth
48+
geth-darwin-386: xgo
49+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=darwin/386 -v $(shell build/flags.sh) ./cmd/geth
50+
@echo "Darwin 386 cross compilation done:"
51+
@ls -l $(GOBIN)/geth-darwin-* | grep 386
52+
53+
geth-darwin-amd64: xgo
54+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=darwin/amd64 -v $(shell build/flags.sh) ./cmd/geth
55+
@echo "Darwin amd64 cross compilation done:"
56+
@ls -l $(GOBIN)/geth-darwin-* | grep amd64
57+
58+
geth-windows: xgo geth-windows-386 geth-windows-amd64
2959
@echo "Windows cross compilation done:"
3060
@ls -l $(GOBIN)/geth-windows-*
3161

32-
geth-android: xgo
33-
build/env.sh $(GOBIN)/xgo --dest=$(GOBIN) --deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 --targets=android-16/*,android-21/* -v $(shell build/flags.sh) ./cmd/geth
62+
geth-windows-386: xgo
63+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=windows/386 -v $(shell build/flags.sh) ./cmd/geth
64+
@echo "Windows 386 cross compilation done:"
65+
@ls -l $(GOBIN)/geth-windows-* | grep 386
66+
67+
geth-windows-amd64: xgo
68+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=windows/amd64 -v $(shell build/flags.sh) ./cmd/geth
69+
@echo "Windows amd64 cross compilation done:"
70+
@ls -l $(GOBIN)/geth-windows-* | grep amd64
71+
72+
geth-android: xgo geth-android-16 geth-android-21
3473
@echo "Android cross compilation done:"
3574
@ls -l $(GOBIN)/geth-android-*
3675

76+
geth-android-16: xgo
77+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=android-16/* -v $(shell build/flags.sh) ./cmd/geth
78+
@echo "Android 16 cross compilation done:"
79+
@ls -l $(GOBIN)/geth-android-16-*
80+
81+
geth-android-21: xgo
82+
build/env.sh $(GOBIN)/xgo --go=$(GO) --dest=$(GOBIN) --deps=$(CROSSDEPS) --targets=android-21/* -v $(shell build/flags.sh) ./cmd/geth
83+
@echo "Android 21 cross compilation done:"
84+
@ls -l $(GOBIN)/geth-android-21-*
85+
3786
evm:
3887
build/env.sh $(GOROOT)/bin/go install -v $(shell build/flags.sh) ./cmd/evm
3988
@echo "Done building."

0 commit comments

Comments
 (0)