forked from 4dogs-cn/TXPortMap
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuildAll.sh
More file actions
executable file
·18 lines (16 loc) · 842 Bytes
/
Copy pathbuildAll.sh
File metadata and controls
executable file
·18 lines (16 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
echo "buildAll TxPortMap..."
os_archs="darwin:amd64 darwin:arm64 freebsd:386 freebsd:amd64 linux:386 linux:amd64 linux:arm linux:arm64 windows:386 windows:amd64 linux:mips64 linux:mips64le linux:mips:softfloat linux:mipsle:softfloat"
LDFLAGS="-s -w"
for n in $os_archs
do
os=$(echo $n | cut -d : -f 1)
arch=$(echo $n | cut -d : -f 2)
gomips=$(echo $n | cut -d : -f 3)
target_suffix="${os}_${arch}"
echo "Build ${os}_${arch} ...."
env CGO_ENABLED=0 GOOS="${os}" GOARCH="${arch}" GOMIPS="${gomips}" go build -trimpath -ldflags "${LDFLAGS}" -o ./release/TxPortMap_"${target_suffix}" ./cmd/TxPortMap/TxPortMap.go
echo "Build ${os}_${arch} done"
done
mv ./release/TxPortMap_windows_386 ./release/TxPortMap_windows_386.exe
mv ./release/TxPortMap_windows_amd64 ./release/TxPortMap_windows_amd64.exe