-
Notifications
You must be signed in to change notification settings - Fork 2
/
PackEngine.bat
268 lines (190 loc) · 7.42 KB
/
PackEngine.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
@echo off
set /p PROJ_NAME="Project Name: "
if %PROJ_NAME% equ "" (
echo Bad project name, abort...
goto EndScript
)
echo Project name set to : %PROJ_NAME%
echo Creating project folder...
mkdir %PROJ_NAME%
echo Entering .\%PROJ_NAME%
cd %PROJ_NAME%
echo Making folder tree...
mkdir Bins
mkdir Lib
cd Bins
mkdir Win64
mkdir Win64\Debug
mkdir Win64\Release
cd ..\Lib
mkdir Debug
mkdir Release
mkdir 3rdParty
cd ..
mkdir Include
mkdir Include\EXPGE
mkdir Include\3rdParty
echo Leaving project dir
cd ..
echo Checking if all files are present...
echo Searching for Debug bins...
cd .\src\x64\Debug
CALL :CheckEngineBins
echo Searching for Release bins...
cd ..\Release
CALL :CheckEngineBins
echo Searching for libs bins...
cd ..\..\libs
CALL :CheckLibBins
echo Searching for libs include folder
CALL :CheckLibIncFolders
echo All files are here, returning to root folder...
cd ..\..\
echo Copying engine files...
CALL :CopyEngineBins
CALL :CopyEngineInclude
CALL :CopyEngineContentFolder
echo Copying libs files...
CALL :CopyLibsBins
CALL :CopyLibsInc
goto EndScript
rem -----------------------------------------------------------------------------------
:CopyLibsInc
echo Copying Libs Include Files
cd src/libs
set INC_PATH=..\..\%PROJ_NAME%\Include\3rdParty\
robocopy AL\include %INC_PATH% /is /it /ndl /njh /nc /ns /njs /e
robocopy BULLET_PHYSICS\include %INC_PATH% /is /it /ndl /njh /nc /ns /njs /e
robocopy GL\include %INC_PATH% /is /it /ndl /njh /nc /ns /njs /e
robocopy JSONCPP\include %INC_PATH% /is /it /ndl /njh /nc /ns /njs /e
robocopy libsndfile\include %INC_PATH% /is /it /ndl /njh /nc /ns /njs /e
cd ..\..
exit /B 0
rem -----------------------------------------------------------------------------------
:CopyLibsBins
set DEBUG_PATH=..\..\%PROJ_NAME%\Bins\Win64\Debug\
set RELEASE_PATH=..\..\%PROJ_NAME%\Bins\Win64\Release\
set DEBUGLIB_PATH=..\..\%PROJ_NAME%\Lib\3rdParty\
echo Copying Debug bins...
cd src/libs
copy /Y AL\bin\Debug\OpenAL32.dll %DEBUG_PATH%\OpenAL32.dll
copy /Y GL\dll\Debug\glew32.dll %DEBUG_PATH%\glew32.dll
copy /Y GL\dll\Debug\glfw3.dll %DEBUG_PATH%\glfw3.dll
copy /Y libsndfile\bin\libsndfile-1.dll %DEBUG_PATH%\libsndfile-1.dll
echo Copying Release bins
copy /Y AL\bin\Release\OpenAL32.dll %RELEASE_PATH%\OpenAL32.dll
copy /Y GL\dll\Release\glew32.dll %RELEASE_PATH%\glew32.dll
copy /Y GL\dll\Release\glfw3.dll %RELEASE_PATH%\glfw3.dll
copy /Y libsndfile\bin\libsndfile-1.dll %RELEASE_PATH%\libsndfile-1.dll
echo Copying Libs lib files...
copy /Y AL\lib\OpenAL32.lib %DEBUGLIB_PATH%\OpenAL32.lib
copy /Y GL\lib\glew32.lib %DEBUGLIB_PATH%\glew32.lib
copy /Y GL\lib\glfw3dll.lib %DEBUGLIB_PATH%\glfw3dll.lib
copy /Y libsndfile\lib\libsndfile-1.lib %DEBUGLIB_PATH%\libsndfile-1.lib
echo All files copied, returning to root directory...
cd ../..
exit /B 0
rem -----------------------------------------------------------------------------------
:CopyEngineContentFolder
echo Copying Engine content folder...
xcopy src\ExGame\Engine\ %PROJ_NAME%\Engine /s /i
exit /B 0
rem -----------------------------------------------------------------------------------
:CopyEngineInclude
echo Copying Engine include files...
cd src/
set INC_EXPGE=..\%PROJ_NAME%\Include\EXPGE
robocopy .\BulldozerFileManager %INC_EXPGE% *.h /is /it /ndl /njh /nc /ns /njs
robocopy .\ExpansionGameEngineCore %INC_EXPGE% *.h /is /it /ndl /njh /nc /ns /njs
robocopy .\ExpansionMath %INC_EXPGE% *.h /is /it /ndl /njh /nc /ns /njs
robocopy .\PhysicaSound %INC_EXPGE% *.h /is /it /ndl /njh /nc /ns /njs
robocopy .\RaindropRenderer %INC_EXPGE% *.h /is /it /ndl /njh /nc /ns /njs
robocopy .\RaindropRenderer\stb %INC_EXPGE%\stb *.h /is /it /ndl /njh /nc /ns /njs
echo Every files copied, returning to root folder...
cd ../
exit /B 0
rem -----------------------------------------------------------------------------------
:CopyEngineBins
set DEBUG_PATH=..\..\..\%PROJ_NAME%\Bins\Win64\Debug\
set RELEASE_PATH=..\..\..\%PROJ_NAME%\Bins\Win64\Release\
set DEBUGLIB_PATH=..\..\..\%PROJ_NAME%\Lib\Debug\
set RELEASELIB_PATH=..\..\..\%PROJ_NAME%\Lib\Release\
echo Copying Debug Bins...
cd src/x64/Debug
copy /Y .\BulldozerFileManager.dll %DEBUG_PATH%\BulldozerFileManager.dll
copy /Y .\ExGame.exe %DEBUG_PATH%\ExGame.exe
copy /Y .\ExpansionGameEngineCore.dll %DEBUG_PATH%\ExpansionGameEngineCore.dll
copy /Y .\ExpansionMath.dll %DEBUG_PATH%\ExpansionMath.dll
copy /Y .\PhysicaSound.dll %DEBUG_PATH%\PhysicaSound.dll
copy /Y .\RaindropRenderer.dll %DEBUG_PATH%\RaindropRenderer.dll
echo Copying Release Bins...
cd ../Release
copy /Y .\BulldozerFileManager.dll %RELEASE_PATH%\BulldozerFileManager.dll
copy /Y .\ExGame.exe %RELEASE_PATH%\ExGame.exe
copy /Y .\ExpansionGameEngineCore.dll %RELEASE_PATH%\ExpansionGameEngineCore.dll
copy /Y .\ExpansionMath.dll %RELEASE_PATH%\ExpansionMath.dll
copy /Y .\PhysicaSound.dll %RELEASE_PATH%\PhysicaSound.dll
copy /Y .\RaindropRenderer.dll %RELEASE_PATH%\RaindropRenderer.dll
echo Copying Debug Lib Files...
copy /Y .\BulldozerFileManager.lib %DEBUGLIB_PATH%\BulldozerFileManager.lib
copy /Y .\ExpansionGameEngineCore.lib %DEBUGLIB_PATH%\ExpansionGameEngineCore.lib
copy /Y .\ExpansionMath.lib %DEBUGLIB_PATH%\ExpansionMath.lib
copy /Y .\PhysicaSound.lib %DEBUGLIB_PATH%\PhysicaSound.lib
copy /Y .\RaindropRenderer.lib %DEBUGLIB_PATH%\RaindropRenderer.lib
echo Copying Release Lib Files...
copy /Y .\BulldozerFileManager.lib %RELEASELIB_PATH%\BulldozerFileManager.lib
copy /Y .\ExpansionGameEngineCore.lib %RELEASELIB_PATH%\ExpansionGameEngineCore.lib
copy /Y .\ExpansionMath.lib %RELEASELIB_PATH%\ExpansionMath.lib
copy /Y .\PhysicaSound.lib %RELEASELIB_PATH%\PhysicaSound.lib
copy /Y .\RaindropRenderer.lib %RELEASELIB_PATH%\RaindropRenderer.lib
echo Copied all Engine bins, returning to root dir
cd ../../../
exit /B 0
rem --------------------------------------------------------------------------------
:CheckLibBins
CALL :CheckFileExistence AL\bin\Debug\OpenAL32.dll
CALL :CheckFileExistence AL\bin\Release\OpenAL32.dll
CALL :CheckFileExistence AL\lib\OpenAL32.lib
CALL :CheckFileExistence GL\dll\Debug\glew32.dll
CALL :CheckFileExistence GL\dll\Debug\glfw3.dll
CALL :CheckFileExistence GL\dll\Release\glew32.dll
CALL :CheckFileExistence GL\dll\Release\glfw3.dll
CALL :CheckFileExistence GL\lib\glew32.lib
CALL :CheckFileExistence GL\lib\glfw3dll.lib
CALL :CheckFileExistence libsndfile\bin\libsndfile-1.dll
CALL :CheckFileExistence libsndfile\lib\libsndfile-1.lib
exit /B 0
rem ----------------------------------------------------------------
:CheckLibIncFolders
CALL :CheckFileExistence AL\include
CALL :CheckFileExistence BULLET_PHYSICS\include
CALL :CheckFileExistence GL\include
CALL :CheckFileExistence JSONCPP\include
CALL :CheckFileExistence libsndfile\include
exit /B 0
rem ------------------------------------------------------------
:CheckEngineBins
CALL :CheckFileExistence BulldozerFileManager.dll
CALL :CheckFileExistence BulldozerFileManager.lib
CALL :CheckFileExistence ExGame.exe
CALL :CheckFileExistence ExpansionGameEngineCore.dll
CALL :CheckFileExistence ExpansionGameEngineCore.lib
CALL :CheckFileExistence ExpansionMath.dll
CALL :CheckFileExistence ExpansionMath.lib
CALL :CheckFileExistence PhysicaSound.dll
CALL :CheckFileExistence PhysicaSound.lib
CALL :CheckFileExistence RaindropRenderer.dll
CALL :CheckFileExistence RaindropRenderer.lib
exit /B 0
rem ---------------------------------------------------
:CheckFileExistence
if exist %~1 (
echo Found %~1
) else (
echo Couln't find %~1, aborting
goto EndScript
)
exit /B 0
:EndScript
pause
exit