-
Notifications
You must be signed in to change notification settings - Fork 342
Expand file tree
/
Copy pathbuild.sh
More file actions
62 lines (58 loc) · 2.71 KB
/
Copy pathbuild.sh
File metadata and controls
62 lines (58 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
echo "
1). Build for Linux
2). Build for Windows
3). Build for MacOS
4). Build for Linux, Windows and MacOS
0). Quit
"
read -rp "Please choose One [ 0-4 ]: " -n 1 chs
case $chs in
1)
# For GNU Linux
CGO_ENABLED=0 GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-amd64
CGO_ENABLED=0 GOARCH=386 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-i386
CGO_ENABLED=0 GOARCH=386 GO386=softfloat go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-i386-softfloat
CGO_ENABLED=0 GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-arm64
CGO_ENABLED=0 GOARCH=arm go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-arm
CGO_ENABLED=0 GOARCH=arm GOARM=5 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-arm-softfloat
;;
2)
# For Windows
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-amd64.exe
GOOS=windows GOARCH=386 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-i386.exe
GOOS=windows GOARCH=386 GO386=softfloat go build -trimpath -ldflags="-s -w" -o ./build/tgpt-i386-softfloat.exe
GOOS=windows GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-arm64.exe
GOOS=windows GOARCH=arm GOARM=5 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-arm-softfloat.exe
;;
3)
# For MacOS
GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-mac-amd64
GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-mac-arm64
;;
4)
# For GNU Linux
GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-amd64
GOARCH=386 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-i386
GOARCH=386 GO386=softfloat go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-i386-softfloat
GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-arm64
GOARCH=arm go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-arm
GOARCH=arm GOARM=5 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-linux-arm-softfloat
# For Windows
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-amd64.exe
GOOS=windows GOARCH=386 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-i386.exe
GOOS=windows GOARCH=386 GO386=softfloat go build -trimpath -ldflags="-s -w" -o ./build/tgpt-i386-softfloat.exe
GOOS=windows GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-arm64.exe
GOOS=windows GOARCH=arm GOARM=5 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-arm-softfloat.exe
# For MacOS
GOOS=darwin GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-mac-amd64
GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o ./build/tgpt-mac-arm64
;;
0)
exit 0
;;
*)
echo "Invalid Options !"
exit 1
;;
esac