From 95cb58aaff55b16470f84bb8801cf17df950d9a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Fri, 15 Sep 2023 10:37:25 +0200 Subject: [PATCH] add run command --- MAKE.bat | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/MAKE.bat b/MAKE.bat index 780cb4b..9ff023c 100644 --- a/MAKE.bat +++ b/MAKE.bat @@ -28,6 +28,7 @@ if "%1"=="help" ( echo %0 [amalgamation] ; combine engine/v4k* into a single-header file echo %0 [prep] ; combine split files into a single-header file, ready for use echo %0 [sln] ; generate a xcode/gmake/ninja/visual studio solution + echo %0 [run] ; run compiled executable after build echo %0 [cl^|tcc^|cc^|gcc^|clang^|clang-cl] [dbg^|dev^|rel] [static^|dll] [nov4k^|nodemos^|editor] [vis] [-- args] echo cl \ echo tcc ^| @@ -631,9 +632,10 @@ if "!vis!"=="yes" echo !cc! !other! !import! !args! !echo! !other! && !cc! !other! !import! !args! || set rc=1 ) -rem if "!run!"=="yes" ( -rem ! -rem ) +if "!run!"=="yes" ( + for /f "tokens=*" %%a in ("!other!") do set exename=%%~na.exe + !exename! || set rc=1 +) rem PAUSE only if double-clicked from Windows explorer (((echo.%cmdcmdline%)|%WINDIR%\system32\find.exe /I "%~0")>nul)&&pause