-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_game.cmd
More file actions
52 lines (43 loc) · 1.47 KB
/
Copy pathrun_game.cmd
File metadata and controls
52 lines (43 loc) · 1.47 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
@echo off
setlocal EnableExtensions
cd /d "%~dp0"
set "MAKE_EXE="
for /f "delims=" %%I in ('where make 2^>nul') do if not defined MAKE_EXE set "MAKE_EXE=%%I"
if not defined MAKE_EXE (
for /f "delims=" %%I in ('where mingw32-make 2^>nul') do if not defined MAKE_EXE set "MAKE_EXE=%%I"
)
set "GXX_EXE="
for /f "delims=" %%I in ('where g++ 2^>nul') do if not defined GXX_EXE set "GXX_EXE=%%I"
set "TOOLCHAIN_BIN="
if defined MAKE_EXE for %%I in ("%MAKE_EXE%") do set "TOOLCHAIN_BIN=%%~dpI"
if not defined TOOLCHAIN_BIN if defined GXX_EXE for %%I in ("%GXX_EXE%") do set "TOOLCHAIN_BIN=%%~dpI"
if defined TOOLCHAIN_BIN set "PATH=%TOOLCHAIN_BIN%;%PATH%"
set "TARGET="
if exist "star_abyss_salvager.exe" set "TARGET=star_abyss_salvager.exe"
if not defined TARGET if exist "star_abyss_salvager" set "TARGET=star_abyss_salvager"
if not defined TARGET (
if not defined MAKE_EXE (
echo Could not find make or mingw32-make in PATH.
pause
exit /b 1
)
call "%MAKE_EXE%"
if errorlevel 1 (
echo Build failed.
pause
exit /b %errorlevel%
)
if exist "star_abyss_salvager.exe" set "TARGET=star_abyss_salvager.exe"
if not defined TARGET if exist "star_abyss_salvager" set "TARGET=star_abyss_salvager"
)
if not defined TARGET (
echo Build finished, but the game executable was not found.
pause
exit /b 1
)
".\%TARGET%"
if errorlevel 1 (
echo Game exited with error code %errorlevel%.
pause
exit /b %errorlevel%
)