Skip to content

Commit 6a05c56

Browse files
committed
makefile: built in cross compilation targets
1 parent be76a68 commit 6a05c56

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Makefile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,30 @@ geth:
1010
@echo "Done building."
1111
@echo "Run \"$(GOBIN)/geth\" to launch geth."
1212

13+
geth-cross: geth-linux geth-darwin geth-windows geth-android
14+
@echo "Full cross compilation done:"
15+
@ls -l $(GOBIN)/geth-*
16+
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 ./cmd/geth
19+
@echo "Linux cross compilation done:"
20+
@ls -l $(GOBIN)/geth-linux-*
21+
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 ./cmd/geth
24+
@echo "Darwin cross compilation done:"
25+
@ls -l $(GOBIN)/geth-darwin-*
26+
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 ./cmd/geth
29+
@echo "Windows cross compilation done:"
30+
@ls -l $(GOBIN)/geth-windows-*
31+
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 ./cmd/geth
34+
@echo "Android cross compilation done:"
35+
@ls -l $(GOBIN)/geth-android-*
36+
1337
evm:
1438
build/env.sh $(GOROOT)/bin/go install -v $(shell build/ldflags.sh) ./cmd/evm
1539
@echo "Done building."
@@ -28,5 +52,8 @@ test: all
2852
travis-test-with-coverage: all
2953
build/env.sh build/test-global-coverage.sh
3054

55+
xgo:
56+
build/env.sh go get github.com/karalabe/xgo
57+
3158
clean:
3259
rm -fr build/_workspace/pkg/ Godeps/_workspace/pkg $(GOBIN)/*

0 commit comments

Comments
 (0)