From a773e6e98f6a304daa2dd5452c8e167de2ab6195 Mon Sep 17 00:00:00 2001 From: zanjie1999 Date: Mon, 21 Aug 2023 17:35:33 +0800 Subject: [PATCH] go build -ldflags="-w -s" --- build.bat | 20 ++++++++++---------- build.sh | 20 ++++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/build.bat b/build.bat index 129a295..f6a3bed 100644 --- a/build.bat +++ b/build.bat @@ -3,36 +3,36 @@ mkdir build SET CGO_ENABLED=1 SET GOARCH=amd64 SET GOOS=windows -go build +go build -ldflags="-w -s" move tcp2ws.exe build\tcp2ws.exe SET GOARCH=386 -go build +go build -ldflags="-w -s" move tcp2ws.exe build\tcp2ws-i386.exe SET CGO_ENABLED=0 SET GOOS=linux -go build +go build -ldflags="-w -s" move tcp2ws build\tcp2ws-linux-i386 SET GOARCH=amd64 -go build +go build -ldflags="-w -s" 7z\7z a tcp2ws-linux.zip tcp2ws copy /b kazari.png+tcp2ws-linux.zip build\tcp2ws-zip-linux.png del tcp2ws-linux.zip move tcp2ws build\tcp2ws-linux SET GOARCH=arm -go build +go build -ldflags="-w -s" move tcp2ws build\tcp2ws-linux-arm SET GOARCH=mips -go build +go build -ldflags="-w -s" move tcp2ws build\tcp2ws-linux-mips SET GOARCH=arm64 -go build +go build -ldflags="-w -s" move tcp2ws build\tcp2ws-linux-arm64 SET GOOS=darwin -go build +go build -ldflags="-w -s" move tcp2ws build\tcp2ws-darwin-arm64 SET GOARCH=amd64 -go build +go build -ldflags="-w -s" move tcp2ws build\tcp2ws-darwin SET GOOS=freebsd -go build +go build -ldflags="-w -s" move tcp2ws build/tcp2ws-freebsd \ No newline at end of file diff --git a/build.sh b/build.sh index 1775eb2..d74bee5 100644 --- a/build.sh +++ b/build.sh @@ -4,37 +4,37 @@ rm -rf build/* export CGO_ENABLED=1 export GOARCH=amd64 export GOOS=windows -go build +go build -ldflags="-w -s" mv tcp2ws.exe build/tcp2ws.exe export GOARCH=386 -go build +go build -ldflags="-w -s" mv tcp2ws.exe build/tcp2ws-i386.exe export CGO_ENABLED=0 export GOOS=linux -go build +go build -ldflags="-w -s" mv tcp2ws build/tcp2ws-linux-i386 export GOARCH=amd64 -go build +go build -ldflags="-w -s" zip tcp2ws-linux.zip tcp2ws cp kazari.png build/tcp2ws-zip-linux.png cat tcp2ws-linux.zip >> build/tcp2ws-zip-linux.png rm tcp2ws-linux.zip mv tcp2ws build/tcp2ws-linux export GOARCH=arm -go build +go build -ldflags="-w -s" mv tcp2ws build/tcp2ws-linux-arm export GOARCH=mips -go build +go build -ldflags="-w -s" mv tcp2ws build/tcp2ws-linux-mips export GOARCH=arm64 -go build +go build -ldflags="-w -s" mv tcp2ws build/tcp2ws-linux-arm64 export GOOS=darwin -go build +go build -ldflags="-w -s" mv tcp2ws build/tcp2ws-darwin-arm64 export GOARCH=amd64 -go build +go build -ldflags="-w -s" mv tcp2ws build/tcp2ws-darwin export GOOS=freebsd -go build +go build -ldflags="-w -s" mv tcp2ws build/tcp2ws-freebsd \ No newline at end of file