适用于 [Linux] ,拷贝代码后新建文件 cross.bash
,并在 ${go 安装路径}/src
目录下执行。
1#!/usr/bin/env bash
2
3export CGO_ENABLED=0
4
5export GOOS=darwin
6export GOARCH=386
7./make.bash
8
9export GOOS=linux
10export GOARCH=386
11./make.bash
12
13export GOOS=windows
14export GOARCH=386
15./make.bash
16
17
18export GOOS=darwin
19export GOARCH=amd64
20./make.bash
21
22export GOOS=linux
23export GOARCH=amd64
24./make.bash
25
26export GOOS=windows
27export GOARCH=amd64
28./make.bash