-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.cmd
67 lines (55 loc) · 1.01 KB
/
Build.cmd
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
63
64
65
66
67
@echo off
if not exist go.mod (
echo Initializing go module...
go mod init main 2> nul
)
if not exist go.sum (
echo Tidying go module...
go mod tidy 2> nul
)
set APP=FLACSFX
:Menu
echo.
echo Generate executable for which operating system and architecture?
echo 1.] Windows x86_64
echo 2.] Windows x86
echo 3.] Linux x86_64
echo 4.] Linux x86
echo 5.] Darwin [Mac] x86_64
echo.
echo X.] Exit
choice /c 12345x /n
goto %ERRORLEVEL%
:1
set GOARCH=amd64
set GOOS=windows
set FILE=%APP%_%GOOS%_%GOARCH%.exe
goto Build
:2
set GOARCH=386
set GOOS=windows
set FILE=%APP%_%GOOS%_%GOARCH%.exe
goto Build
:3
set GOARCH=amd64
set GOOS=linux
set FILE=%APP%_%GOOS%_%GOARCH%
goto Build
:4
set GOARCH=386
set GOOS=linux
set FILE=%APP%_%GOOS%_%GOARCH%
goto Build
:5
set GOARCH=amd64
set GOOS=darwin
set FILE=%APP%_%GOOS%_%GOARCH%.app
goto Build
:6
exit /b
:Build
echo Building "Release/%FILE%"...
call go build -ldflags="-s -w" -o "Release/%FILE%" %APP%.go
if %ERRORLEVEL%==0 (echo Build successful!
) else echo Build unsuccessful!
goto Menu