2019-07-17 06:30:40 +00:00
|
|
|
param (
|
|
|
|
[switch]$clean = $false
|
|
|
|
)
|
2019-07-17 06:20:52 +00:00
|
|
|
$env:GOARCH="amd64"
|
2019-07-30 06:59:32 +00:00
|
|
|
foreach($sys in ("amd64-linux", "arm-linux", "amd64-freebsd", "amd64-openbsd", "amd64-darwin", "amd64-windows")) {
|
|
|
|
$cpu,$os = $sys.split('-')
|
|
|
|
$env:GOARCH=$cpu
|
|
|
|
$env:GOOS=$os
|
|
|
|
$o="wrp-$cpu-$(if ($os -eq "windows") {$os="windows.exe"} elseif ($os -eq "darwin") { $os="macos" })$os"
|
2019-07-17 06:30:40 +00:00
|
|
|
Remove-Item -ErrorAction Ignore $o
|
|
|
|
if (!$clean) {
|
2019-07-30 06:59:32 +00:00
|
|
|
$cmd = "& go build -a -o $o wrp.go"
|
|
|
|
Write-Host $cmd
|
|
|
|
Invoke-Expression $cmd
|
2019-07-17 06:30:40 +00:00
|
|
|
}
|
2019-07-17 06:20:52 +00:00
|
|
|
}
|
|
|
|
|