mirror of
https://forge.fsky.io/oneflux/omegafox.git
synced 2026-02-10 18:42:04 -08:00
- Allow multiple OS & arch build targets to be passed in multibuild.py - Add make set-target to change target OS & arch - Cleanup/refactor patch.py and package.py, move common functions to mixin file
31 lines
No EOL
607 B
Bash
31 lines
No EOL
607 B
Bash
#!/bin/bash
|
|
|
|
if [ $# -ne 2 ]; then
|
|
echo "Usage: $0 <arch> <os>"
|
|
echo "arch: x86_64, i686, arm64"
|
|
echo "os: linux, windows, macos"
|
|
exit 1
|
|
fi
|
|
|
|
ARCH=$1
|
|
OS=$2
|
|
|
|
case $ARCH in
|
|
x86_64) GOARCH=amd64 ;;
|
|
i686) GOARCH=386 ;;
|
|
arm64) GOARCH=arm64 ;;
|
|
*) echo "Invalid architecture"; exit 1 ;;
|
|
esac
|
|
|
|
case $OS in
|
|
linux) GOOS=linux ;;
|
|
windows) GOOS=windows ;;
|
|
macos) GOOS=darwin ;;
|
|
*) echo "Invalid OS"; exit 1 ;;
|
|
esac
|
|
|
|
[ "$OS" = "windows" ] && OUTPUT="launch.exe" || OUTPUT="launch"
|
|
|
|
GOOS=$GOOS GOARCH=$GOARCH go build -o dist/$OUTPUT
|
|
|
|
echo "Built: $OUTPUT" |