• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mitchellh/gox: A dead simple, no frills Go cross compile tool

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

mitchellh/gox

开源软件地址:

https://github.com/mitchellh/gox

开源编程语言:

Go 100.0%

开源软件介绍:

Gox - Simple Go Cross Compilation

Gox is a simple, no-frills tool for Go cross compilation that behaves a lot like standard go build. Gox will parallelize builds for multiple platforms. Gox will also build the cross-compilation toolchain for you.

Installation

To install Gox, please use go get. We tag versions so feel free to checkout that tag and compile.

$ go get github.com/mitchellh/gox
...
$ gox -h
...

Usage

If you know how to use go build, then you know how to use Gox. For example, to build the current package, specify no parameters and just call gox. Gox will parallelize based on the number of CPUs you have by default and build for every platform by default:

$ gox
Number of parallel builds: 4

-->      darwin/386: github.com/mitchellh/gox
-->    darwin/amd64: github.com/mitchellh/gox
-->       linux/386: github.com/mitchellh/gox
-->     linux/amd64: github.com/mitchellh/gox
-->       linux/arm: github.com/mitchellh/gox
-->     freebsd/386: github.com/mitchellh/gox
-->   freebsd/amd64: github.com/mitchellh/gox
-->     openbsd/386: github.com/mitchellh/gox
-->   openbsd/amd64: github.com/mitchellh/gox
-->     windows/386: github.com/mitchellh/gox
-->   windows/amd64: github.com/mitchellh/gox
-->     freebsd/arm: github.com/mitchellh/gox
-->      netbsd/386: github.com/mitchellh/gox
-->    netbsd/amd64: github.com/mitchellh/gox
-->      netbsd/arm: github.com/mitchellh/gox
-->       plan9/386: github.com/mitchellh/gox

Or, if you want to build a package and sub-packages:

$ gox ./...
...

Or, if you want to build multiple distinct packages:

$ gox github.com/mitchellh/gox github.com/hashicorp/serf
...

Or if you want to just build for linux:

$ gox -os="linux"
...

Or maybe you just want to build for 64-bit linux:

$ gox -osarch="linux/amd64"
...

And more! Just run gox -h for help and additional information.

Versus Other Cross-Compile Tools

A big thanks to these other options for existing. They each paved the way in many aspects to make Go cross-compilation approachable.

  • Dave Cheney's golang-crosscompile - Gox compiles for multiple platforms and can therefore easily run on any platform Go supports, whereas Dave's scripts require a shell. Gox will also parallelize builds. Dave's scripts build sequentially. Gox has much easier to use OS/Arch filtering built in.

  • goxc - A very richly featured tool that can even do things such as build system packages, upload binaries, generate download webpages, etc. Gox is a super slim alternative that only cross-compiles binaries. Gox builds packages in parallel, whereas goxc doesn't. Gox doesn't enforce a specific output structure for built binaries.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap