-
Notifications
You must be signed in to change notification settings - Fork 1
/
ETHminerBuildScriptDmW.bat
292 lines (259 loc) · 8.08 KB
/
ETHminerBuildScriptDmW.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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
rem ========== PreStart ==========
@echo off
chcp 65001
rem Set version info
set V=3.5.3
rem ========== Start ==========
cls
echo ###############################################################################
echo.
echo ETHminerBuildScriptDmW Version %V%
echo.
echo AUTHOR: DeadManWalking (DeadManWalkingTO-GitHub)
echo (https://github.com/DeadManWalkingTO)
echo.
echo ###############################################################################
echo.
echo ETHminerBuildScriptDmW
echo 1. Auto Remove old Ethminer's Directory
echo 2. Auto Clone (Download) latest Master of Ethminer
echo 3. Auto Configure Ethminer
echo 4. Auto Build Ethminer
echo.
pause
echo.
echo.
rem ========== Initializing ==========
setlocal
set DmW_Project_Name_V=Ethminer
set DmW_Project_Name=ethminer
set DmW_Project_Git=https://github.com/ethereum-mining/ethminer.git
set DmW_Project_VS=2017
rem Call Microsoft Visual C++ Build Tools
echo ==================================================
echo Call Microsoft Visual C++ Build Tools
echo.
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\Tools\VsDevCmd.bat"
if ERRORLEVEL 0 (goto :BT_OK) ELSE goto :BT_2015
:BT_2015
call "C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools_msbuild.bat"
if not %ERRORLEVEL%==0 echo. & echo Fail & pause & goto :eof
set DmW_Project_VS=2015
:BT_OK
echo.
echo Done
echo ==================================================
echo.
timeout 1 > nul
rem Back to Directory
echo ==================================================
echo Back to Directory
echo.
cd "%~dp0\"
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem ========== Run ==========
rem Remove old Project's Directory
echo ==================================================
echo Remove old %DmW_Project_Name_V%'s Directory
echo.
rmdir /S /Q %DmW_Project_Name%
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Download Project
echo ==================================================
echo Download %DmW_Project_Name_V%
echo.
git clone --depth=1 --branch=master %DmW_Project_Git%
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Change Directory to Project's
echo ==================================================
echo Change Directory to %DmW_Project_Name_V%'s
echo.
cd %DmW_Project_Name%
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Git Fetch
echo ==================================================
echo Git Fetch
echo.
git fetch -q origin
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Git Checkout
echo ==================================================
echo Git Checkout
echo.
git checkout -qf FETCH_HEAD
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Git Submodule
echo ==================================================
echo Git Submodule
echo.
git submodule update --init --recursive
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Make Build Directory
echo ==================================================
echo Make Build Directory
echo.
if not exist build mkdir build
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Change Directory to Build
echo ==================================================
echo Change Directory to Build
echo.
cd build
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Configure Project
echo ==================================================
echo Configure %DmW_Project_Name_V%
echo.
:1000
set /A Pline=1000
set DmW_MSG=Enable CUDA mining.
echo %DmW_MSG%
set /p Dmw_Select="Enable? y/n: "
if '%Dmw_Select%' == 'y' set /A Pline=%Pline%+1
if '%Dmw_Select%' == 'n' set /A Pline=%Pline%+2
goto %Pline%
:1001
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DETHASHCUDA=ON
set /A Pline=%Pline%+9
goto %Pline%
:1002
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DETHASHCUDA=OFF
set /A Pline=%Pline%+8
goto %Pline%
:1010
set DmW_MSG=Enable OpenCL mining.
echo %DmW_MSG%
set /p Dmw_Select="Enable? y/n: "
if '%Dmw_Select%' == 'y' set /A Pline=%Pline%+1
if '%Dmw_Select%' == 'n' set /A Pline=%Pline%+2
goto %Pline%
:1011
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DETHASHCL=ON
set /A Pline=%Pline%+9
goto %Pline%
:1012
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DETHASHCL=OFF
rem Skip Install AMD binary kernels
set /A Pline=%Pline%+10
goto %Pline%
:1020
set DmW_MSG=Install AMD binary kernels.
echo %DmW_MSG%
set /p Dmw_Select="Install? y/n: "
if '%Dmw_Select%' == 'y' set /A Pline=%Pline%+1
if '%Dmw_Select%' == 'n' set /A Pline=%Pline%+2
goto %Pline%
:1021
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DBINKERN=ON
set /A Pline=%Pline%+9
goto %Pline%
:1022
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DBINKERN=OFF
set /A Pline=%Pline%+8
goto %Pline%
:1030
set DmW_MSG=Enable D-Bus support, OFF by default.
echo %DmW_MSG%
set /p Dmw_Select="Enable? y/n: "
if '%Dmw_Select%' == 'y' set /A Pline=%Pline%+1
if '%Dmw_Select%' == 'n' set /A Pline=%Pline%+2
goto %Pline%
:1031
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DETHDBUS=ON
set /A Pline=%Pline%+9
goto %Pline%
:1032
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DETHDBUS=OFF
set /A Pline=%Pline%+8
goto %Pline%
:1040
set DmW_MSG=Enable API Server.
echo %DmW_MSG%
set /p Dmw_Select="Enable? y/n: "
if '%Dmw_Select%' == 'y' set /A Pline=%Pline%+1
if '%Dmw_Select%' == 'n' set /A Pline=%Pline%+2
goto %Pline%
:1041
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DAPICORE=ON
set /A Pline=%Pline%+9
goto %Pline%
:1042
set DmW_CMAKE_CONFIG=%DmW_CMAKE_CONFIG% -DAPICORE=OFF
set /A Pline=%Pline%+8
goto %Pline%
:1050
echo.
if '%DmW_Project_VS%'=='2017' (echo VS2017 & set DmW_Project_VS_C="Visual Studio 15 2017 Win64") else (echo.)
if '%DmW_Project_VS%'=='2015' (echo VS2015 & set DmW_Project_VS_C="Visual Studio 14 2015 Win64" -T v140,host=x64) else (echo.)
set DmW_CMAKE_CONFIG=%DmW_Project_VS_C% %DmW_CMAKE_CONFIG%
set /A Pline=%Pline%+10
goto %Pline%
:1060
cmake .. -G %DmW_CMAKE_CONFIG%
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Build Project
echo ==================================================
echo Build %DmW_Project_Name_V%
echo.
cmake --build . --config Release
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Copy Project to Home Directory
echo ==================================================
echo Copy %DmW_Project_Name_V% to Home Directory
echo.
copy "%~dp0\%DmW_Project_Name%\build\ethminer\Release\ethminer.exe" "%~dp0\ethminer.exe"
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem Back to Directory
echo ==================================================
echo Change Directory to Home
echo.
cd "%~dp0\"
if %ERRORLEVEL%==0 (echo. & echo Done) else (echo. & echo Fail & pause & goto :eof)
echo ==================================================
echo.
timeout 1 > nul
rem ETHminerBuildScriptDmW was completed
echo ==================================================
echo ETHminerBuildScriptDmW was completed successfully.
echo ==================================================
rem ========== End ==========
endlocal
pause
echo.
rem ========== EoF ==========