-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile.bat
77 lines (65 loc) · 2.45 KB
/
makefile.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
@echo off
color 0a
title Compile EasyDoc
set goName=encryptTool.go
set execName=encryptTool
set version=1.0
::Cross compile is not support CGO
set CGO_ENABLED=0
@echo Compile windows 64 bit...
set GOOS=windows
set GOARCH=amd64
set GOEXE=.exe
::mkdir %execName%-%version%-%GOOS%-%GOARCH%
go build -ldflags="-H windowsgui"
::去掉符号表后不知为何系统崩溃了go build -ldflags="-s -w" -o %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE% %goName%
::去壳工具报错,不知道是啥意思upx %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE%
::rar a %execName%-%version%-%GOOS%-%GOARCH%.zip -r %execName%-%version%-%GOOS%-%GOARCH%
@echo.
goto end
@echo Compile windows 32 bit...
set GOOS=windows
set GOARCH=386
set GOEXE=.exe
mkdir %execName%-%version%-%GOOS%-%GOARCH%
go build -ldflags="-s -w" -o %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE% %goName%
upx %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE%
::rar a %execName%-%version%-%GOOS%-%GOARCH%.zip -r %execName%-%version%-%GOOS%-%GOARCH%
@echo.
@echo Compile Linux 32 bit...
set GOOS=linux
set GOARCH=386
set GOEXE=
mkdir %execName%-%version%-%GOOS%-%GOARCH%
go build -ldflags="-s -w" -o %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE% %goName%
upx %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE%
::rar a %execName%-%version%-%GOOS%-%GOARCH%.zip -r %execName%-%version%-%GOOS%-%GOARCH%
@echo.
@echo Compile Linux 64 bit...
set GOOS=linux
set GOARCH=amd64
set GOEXE=
mkdir %execName%-%version%-%GOOS%-%GOARCH%
go build -ldflags="-s -w" -o %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE% %goName%
upx %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE%
::rar a %execName%-%version%-%GOOS%-%GOARCH%.zip -r %execName%-%version%-%GOOS%-%GOARCH%
@echo.
@echo Compile Mac 32 bit...
set GOOS=darwin
set GOARCH=386
set GOEXE=
mkdir %execName%-%version%-%GOOS%-%GOARCH%
go build -ldflags="-s -w" -o %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE% %goName%
upx %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE%
::rar a %execName%-%version%-%GOOS%-%GOARCH%.zip -r %execName%-%version%-%GOOS%-%GOARCH%
@echo.
@echo Compile Mac 64 bit...
set GOOS=darwin
set GOARCH=amd64
set GOEXE=
mkdir %execName%-%version%-%GOOS%-%GOARCH%
go build -ldflags="-s -w" -o %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE% %goName%
upx %execName%-%version%-%GOOS%-%GOARCH%\%execName%%GOEXE%
::rar a %execName%-%version%-%GOOS%-%GOARCH%.zip -r %execName%-%version%-%GOOS%-%GOARCH%
@echo.
:end