-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake.bat
60 lines (48 loc) · 1011 Bytes
/
make.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
@echo off
REM Första gången : ./make.bat setup
REM Kör tester : ./make.bat test
REM Kör tester pratsamt: ./make.bat test verbose
REM Bygg för användning: ./make.sh release
REM Bygg för utveckling: ./make.sh
SET ARG1=%1
SET ARG2=%2
FOR /F %%I IN ('go env GOOS') DO SET GOOS=%%I
FOR /F %%I IN ('go env GOARCH') DO SET GOARCH=%%I
IF NOT "%GOOS%"=="windows" (
ECHO "Only intended for windows."
EXIT
)
DEL HHEK2sqlite.exe
IF "%ARG1%"=="setup" (
ECHO Hämtar beroenden...
go get github.com/alexbrainman/odbc
go get github.com/mattn/go-sqlite3
go get golang.org/x/text/encoding/charmap
ECHO Klar.
EXIT
)
IF "%ARG1%"=="clean" (
del *~
del #*#
del .#*
EXIT
)
IF "%ARG1%"=="test" (
IF "%ARG2%"=="verbose" (
SET BUILDCMD=test -v
) else (
SET BUILDCMD=test
)
) else (
SET BUILDCMD=build -o HHEK2sqlite.exe
)
IF "%ARG1%"=="release" (
SET LINKCMD=-ldflags="-s -w"
) else (
SET LINKCMD=
)
ECHO Bygger...
@echo on
go %BUILDCMD% %LINKCMD%
@echo off
ECHO Klar.