Go 编译跨平台

Published on in 编程语言 with 11,495 views and 1 comments

适用于 [Linux] ,拷贝代码后新建文件 cross.bash,并在 ${go 安装路径}/src 目录下执行。

#!/usr/bin/env bash

export CGO_ENABLED=0

export GOOS=darwin
export GOARCH=386
./make.bash

export GOOS=linux
export GOARCH=386
./make.bash

export GOOS=windows
export GOARCH=386
./make.bash


export GOOS=darwin
export GOARCH=amd64
./make.bash

export GOOS=linux
export GOARCH=amd64
./make.bash

export GOOS=windows
export GOARCH=amd64
./make.bash

---- EOF ----

Responses
  • 大D

    要不再做一套gobuild系统。。。

    原先那个已经关站了

    该评论同步自 黑客派

    Reply