mirror of
https://github.com/tenox7/wrp.git
synced 2024-11-22 10:31:21 +00:00
better ps make script
This commit is contained in:
parent
749f8bea5d
commit
7a27cf7b62
17
make.ps1
17
make.ps1
@ -2,19 +2,16 @@ param (
|
||||
[switch]$clean = $false
|
||||
)
|
||||
$env:GOARCH="amd64"
|
||||
foreach($os in ("linux", "freebsd", "openbsd", "darwin", "windows")) {
|
||||
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-$(if ($os -eq "windows") {$os="windows.exe"} elseif ($os -eq "darwin") { $os="macos" })$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"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user