diff --git a/make.ps1 b/make.ps1 index 6d94397..31b80b1 100644 --- a/make.ps1 +++ b/make.ps1 @@ -2,19 +2,16 @@ param ( [switch]$clean = $false ) $env:GOARCH="amd64" -foreach($os in ("linux", "freebsd", "openbsd", "darwin", "windows")) { - $env:GOOS=$os - $o="wrp-$(if ($os -eq "windows") {$os="windows.exe"} elseif ($os -eq "darwin") { $os="macos" })$os" +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" Remove-Item -ErrorAction Ignore $o if (!$clean) { - Invoke-Expression "& go build -a -o $o wrp.go" + $cmd = "& go build -a -o $o wrp.go" + Write-Host $cmd + Invoke-Expression $cmd } } -$env:GOARCH="arm" -$env:GOOS="linux" -$o="wrp-linux-rpi" -Remove-Item -ErrorAction Ignore $o -if (!$clean) { - Invoke-Expression "& go build -a -o $o wrp.go" -}