From a66d312a87f6b710c51877c39094cfacd64b097b Mon Sep 17 00:00:00 2001 From: KevinZonda <33132228+KevinZonda@users.noreply.github.com> Date: Sun, 17 May 2020 12:22:04 +0800 Subject: [PATCH] [tool] add build tool --- .gitignore | 1 + build.bat | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .gitignore create mode 100644 build.bat diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..30b81db --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +release \ No newline at end of file diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..1537abc --- /dev/null +++ b/build.bat @@ -0,0 +1,46 @@ +@echo off +echo =========================== +echo = Go Cross Compile Script = +echo = by Kevin = +echo =========================== + +echo -^> Removing old files +del /s /Q release > nul + +SET CGO_ENABLED=0 +echo -^> Compiling AMD64 +SET GOARCH=amd64 + +SET GOOS=windows +echo --^> Compiling Windows +go build -o release\fgit-windows-amd64.exe fgit.go +SET GOOS=darwin +echo --^> Compiling Darwin +go build -o release\fgit-darwin-amd64 fgit.go +SET GOOS=linux +echo --^> Compiling Linux +go build -o release\fgit-linux-amd64 fgit.go + +SET GOARCH=386 +echo -^> Compiling 386 +SET GOOS=windows +echo --^> Compiling Windows +go build -o release\fgit-windows-386.exe fgit.go +SET GOOS=linux +echo --^> Compiling Linux +go build -o release\fgit-linux-386 fgit.go + + +SET GOARCH=arm +echo -^> Compiling ARM +SET GOOS=linux +echo --^> Compiling Linux +go build -o release\fgit-linux-arm fgit.go + +SET GOARCH=arm64 +echo -^> Compiling ARM64 +SET GOOS=linux +echo --^> Compiling Linux +go build -o release\fgit-linux-arm64 fgit.go + +pause \ No newline at end of file