-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build.cmd
53 lines (43 loc) · 840 Bytes
/
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
@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=KanziSFX
:Menu
echo.
echo Generate executable for which operating system and architecture?
echo 1.] Windows x86_64
echo 3.] Linux x86_64
echo 5.] Darwin [Mac] x86_64
echo.
echo X.] Exit
choice /c 123x /n
goto %errorlevel%
:1
set GOARCH=amd64
set GOOS=windows
set file=%app%_%GOOS%_%GOARCH%.exe
goto Build
:2
set GOARCH=amd64
set GOOS=linux
set file=%app%_%GOOS%_%GOARCH%
goto Build
:3
set GOARCH=amd64
set GOOS=darwin
set file=%app%_%GOOS%_%GOARCH%.app
goto Build
:4
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