go_echo_wol/bulid.sh

46 lines
916 B
Bash
Raw Normal View History

2023-09-13 10:05:09 +08:00
#!/bin/bash
CPU_architecture="darwin/amd64
darwin/arm64
freebsd/386
freebsd/amd64
freebsd/arm
freebsd/arm64
linux/386
linux/amd64
linux/arm
linux/arm64
linux/loong64
linux/mips
linux/mips64
linux/mips64le
linux/mipsle
linux/ppc64
linux/ppc64le
linux/riscv64
linux/s390x
netbsd/386
netbsd/amd64
netbsd/arm
netbsd/arm64
openbsd/386
openbsd/amd64
openbsd/arm
openbsd/arm64
openbsd/mips64
windows/386
windows/amd64
windows/arm
windows/arm64"
for line in $CPU_architecture
do
array=(${line//\// })
extension=""
if [ "${array[0]}" == "windows" ];then
extension=".exe"
fi
echo "Start compiling the system:${array[0]} architecture:${array[1]}"
# echo "CGO_ENABLED=0 GOOS=${array[0]} GOARCH=${array[1]} go build -o /root/web/${array[0]}_${array[1]}_main${extension}"
CGO_ENABLED=0 GOOS=${array[0]} GOARCH=${array[1]} go build -o /root/web/${array[0]}_${array[1]}_main${extension}
done