-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcompile.bat
More file actions
99 lines (79 loc) · 2.65 KB
/
compile.bat
File metadata and controls
99 lines (79 loc) · 2.65 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
@echo off
setlocal EnableDelayedExpansion
set TOOLCHAIN=0
set RCCETOOLS=1
set RCCE=1
set ROOTDIR=%CD%
:parse_args
if "%1"=="" goto end_args
if "%1"=="-b" (
set TOOLCHAIN=1
) else if "%1"=="--blitz" (
set TOOLCHAIN=1
) else if "%1"=="-t" (
set RCCETOOLS=0
) else if "%1"=="--skip-tools" (
set RCCETOOLS=0
) else if "%1"=="-h" (
goto help_text
) else if "%1"=="--help" (
goto help_text
) else if "%1"=="-e" (
set RCCE=0
) else if "%1"=="--skip-engine" (
set RCCE=0
) else (
echo Unknown flag: %1
endlocal
exit /b 1
)
shift
goto parse_args
:help_text
echo RCCE2 Compiler Script
echo.
echo -t ^| --skip-tools Skip compilation of the RCCE2 tool applications in \src\tools
echo -b ^| --blitz Compile the BlitzForge toolchain
echo -e ^| --skip-engine Skip compilation of the RCCE2 engine itself in \src
endlocal
exit /b
:end_args
if %TOOLCHAIN%==1 (
echo Compiling BlitzForge Toolchain...
call %ROOTDIR%\scripts\submodules_init.bat
call %ROOTDIR%\compiler\BlitzForge\scripts\msbuild_init.bat
cd %ROOTDIR%
call %ROOTDIR%\compiler\BlitzForge\scripts\msbuild_blitzforge.bat
)
if %RCCE%==1 (
IF NOT EXIST "%ROOTDIR%\compiler\BlitzForge\bin\blitzcc.exe" (
echo "%ROOTDIR%\compiler\BlitzForge\bin\blitzcc.exe not found!"
echo "Compile source or download binaries from https://github.com/RydeTec/blitz-forge/releases"
exit 1;
)
echo Compiling RealmCrafter CE Engine...
cd %ROOTDIR%\src
set BLITZPATH=%ROOTDIR%\compiler\BlitzForge
"!BLITZPATH!\bin\blitzcc.exe" -o "%ROOTDIR%\bin\Server.exe" "%ROOTDIR%\src\Server.bb"
"!BLITZPATH!\bin\blitzcc.exe" -o "%ROOTDIR%\Project Manager.exe" -n "%ROOTDIR%\res\Icon.ico" "%ROOTDIR%\src\Project Manager.bb"
"!BLITZPATH!\bin\blitzcc.exe" -o "%ROOTDIR%\bin\GUE.exe" -n "%ROOTDIR%\res\Icon.ico" "%ROOTDIR%\src\GUE.bb"
"!BLITZPATH!\bin\blitzcc.exe" -o "%ROOTDIR%\bin\Client.exe" -n "%ROOTDIR%\res\Icon.ico" "%ROOTDIR%\src\Client.bb"
)
if %RCCETOOLS%==1 (
IF NOT EXIST "%ROOTDIR%\compiler\BlitzForge\bin\blitzcc.exe" (
echo "%ROOTDIR%\compiler\BlitzForge\bin\blitzcc.exe not found!"
echo "Compile source or download binaries from https://github.com/RydeTec/blitz-forge/releases"
exit 1;
)
echo Compiling RealmCrafter CE Tools...
if not exist "%ROOTDIR%\bin\tools" (
mkdir "%ROOTDIR%\bin\tools"
)
cd %ROOTDIR%\src\tools
set "BLITZPATH=%ROOTDIR%\compiler\BlitzForge"
for %%f in (*.bb) do (
"!BLITZPATH!\bin\blitzcc.exe" -o "%ROOTDIR%\bin\tools\%%~nf.exe" -n "%ROOTDIR%\res\Icon.ico" -w "%ROOTDIR%\src" "%ROOTDIR%\src\tools\%%~nf.bb"
)
)
cd %ROOTDIR%
endlocal