This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
compiler.bat
61 lines (47 loc) · 1.61 KB
/
compiler.bat
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
@ECHO off
:: --------------------------------------------------------------------------------
::
:: Author: SegoCode
::
:: Script function:
:: Create release binary for golang script on different OS
::
:: Note:
:: You need golang.org/x/sys/unix dependence in your system if
:: you want to compile for linux, run 'go get golang.org/x/sys/unix'
::
:: For compiling without go.mod file set GO111MODULE to off, this
:: isnt recommended, if you dont have go.mod run 'go mod init main'
:: and 'go mod tidy' for create the go.mod file
::
:: Be sure there is no binary from any previous build in the root directory
::
:: --------------------------------------------------------------------------------
:: --------------------------------------------------------------------------------
:: Change the values shown below they must match the name of the file to compile
SET gofile=swd.go
SET gofilename=swd
:: --------------------------------------------------------------------------------
CD %~dp0
ECHO Compiling for: linux-amd64. . .
SET GOOS=linux
SET GOARCH=amd64
go build -o "%gofilename%-%GOOS%-%GOARCH%" %gofile%
ECHO Compiling for: linux-386. . .
SET GOOS=linux
SET GOARCH=386
go build -o "%gofilename%-%GOOS%-%GOARCH%" %gofile%
ECHO Compiling for: linux-arm. . .
SET GOOS=linux
SET GOARCH=arm
go build -o "%gofilename%-%GOOS%-%GOARCH%" %gofile%
ECHO Compiling for: windows-386. . .
SET GOOS=windows
SET GOARCH=386
go build -o "%gofilename%-%GOOS%-%GOARCH%.exe" %gofile%
ECHO Compiling for: windows-amd64. . .
SET GOOS=windows
SET GOARCH=amd64
go build -o "%gofilename%-%GOOS%-%GOARCH%.exe" %gofile%
ECHO DONE!
pause > nul