wrp/make.ps1
2019-08-12 23:34:03 -07:00

17 lines
531 B
PowerShell

param (
[switch]$clean = $false
)
foreach($sys in ("amd64-linux", "arm-linux", "arm-netbsd", "arm-freebsd", "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"
Remove-Item -ErrorAction Ignore $o
if (!$clean) {
$cmd = "& go build -a -o $o wrp.go"
Write-Host $cmd
Invoke-Expression $cmd
}
}