File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ @ echo off
2+ setlocal enabledelayedexpansion
3+
4+ set PKGSRC = github.com/yggdrasil-network/yggdrasil-go/src/version
5+
6+ set LDFLAGS = -X %PKGSRC% .buildName=%PKGNAME% -X %PKGSRC% .buildVersion=%PKGVER%
7+ set ARGS = -v
8+
9+ :parse_args
10+ if " %1 " == " " goto end_args
11+ if " %1 " == " -u" set UPX = true
12+ if " %1 " == " -t" set TABLES = true
13+ if " %1 " == " -d" set ARGS = %ARGS% -tags debug & set DEBUG = true
14+ if " %1 " == " -r" set ARGS = %ARGS% -race
15+ if " %1 " == " -p" set ARGS = %ARGS% -buildmode=pie
16+ if " %1 " == " -c" (
17+ shift
18+ set GCFLAGS = %GCFLAGS% %1
19+ )
20+ if " %1 " == " -l" (
21+ shift
22+ set LDFLAGS = %LDFLAGS% %1
23+ )
24+ if " %1 " == " -o" (
25+ shift
26+ set ARGS = %ARGS% -o %1
27+ )
28+ shift
29+ goto parse_args
30+
31+ :end_args
32+ if " %TABLES% " == " " if " %DEBUG% " == " " (
33+ set LDFLAGS = %LDFLAGS% -s -w
34+ )
35+
36+ for %%C in (yggdrasil yggdrasilctl) do (
37+ echo Building: %%C .exe
38+ go build %ARGS% -ldflags=" %LDFLAGS% " -gcflags=" %GCFLAGS% " ./cmd/%%C
39+
40+ if " %UPX% " == " true" (
41+ upx --brute %%C .exe
42+ )
43+ )
You can’t perform that action at this time.
0 commit comments