diff --git a/Tools/build.bat b/Tools/build.bat index fa45e9a..b213a51 100644 --- a/Tools/build.bat +++ b/Tools/build.bat @@ -2,7 +2,7 @@ set Source=%1 -if "%Source%"=="" ( +if #%Source%#==## ( echo Usage: %~n0 [source-file] goto exit ) @@ -21,11 +21,11 @@ if not exist "%~dp0..\RTL\SysInit.dcu" call "%~dp0..\build-RTL.bat" if errorlevel 1 goto exit if not exist "%Bin%\convert.bat" ( - echo @%%~dp0..\Tools\convert.bat %%* >"%Bin%\convert.bat" + echo @call "%%~dp0..\Tools\convert.bat" %%* >"%Bin%\convert.bat" if errorlevel 1 goto exit ) -dcc32 "%Source%.dpr" -e"%Bin%" -n"%DCU%" -u"%Units%" %Options% +dcc32 %Source%.dpr -e"%Bin%" -n"%DCU%" -u"%Units%" %Options% if errorlevel 1 goto exit call "%~dp0convert.bat" "%Target%.exe" diff --git a/Tools/convert.bat b/Tools/convert.bat index 9797649..f7a4bc4 100644 --- a/Tools/convert.bat +++ b/Tools/convert.bat @@ -1,6 +1,6 @@ @echo off -if "%1"=="" ( +if #%1#==## ( echo Usage: %~n0 [source-file.exe [pet-options]] goto exit ) @@ -8,9 +8,9 @@ if "%1"=="" ( "%~dp0..\Pet" -nologo -strip -trunc -dropsect .idata,.rsrc -rebase 0 -osver 0.7 -log brief -into %* if errorlevel 1 goto exit -"%~dp0..\exe2kos" "%1" +"%~dp0..\exe2kos" %1 if errorlevel 1 goto exit -%~dp0..\kpack "%~dp1%~n1" +"%~dp0..\kpack" "%~dp1%~n1" :exit \ No newline at end of file diff --git a/build-RTL.bat b/build-RTL.bat index 85b4a11..e97f1a3 100644 --- a/build-RTL.bat +++ b/build-RTL.bat @@ -1 +1 @@ -@dcc32 -m -y -z %~dp0RTL\System -n%~dp0\RTL %* \ No newline at end of file +@dcc32 -m -y -z "%~dp0RTL\System" -n"%~dp0\RTL" %* \ No newline at end of file diff --git a/build-all.bat b/build-all.bat index 201fa7f..d9c171b 100644 --- a/build-all.bat +++ b/build-all.bat @@ -1,3 +1,3 @@ @echo off -call build-examples.bat -call build-my.bat \ No newline at end of file +call "%~dp0build-examples.bat" +call "%~dp0build-my.bat" \ No newline at end of file diff --git a/build-examples.bat b/build-examples.bat index 8e6fef9..e7f6298 100644 --- a/build-examples.bat +++ b/build-examples.bat @@ -1,12 +1,12 @@ @echo off -for /d %%f in (%~dp0Examples\Console\*) do ( - call %%f\build.bat +for /d %%f in ("%~dp0Examples\Console\*") do ( + if exist "%%f\build.bat" call "%%f\build.bat" if errorlevel 1 goto exit ) -for /d %%f in (%~dp0Examples\GUI\*) do ( - call %%f\build.bat +for /d %%f in ("%~dp0Examples\GUI\*") do ( + if exist "%%f\build.bat" call "%%f\build.bat" if errorlevel 1 goto exit ) diff --git a/build-my.bat b/build-my.bat index 9e3cc46..697b953 100644 --- a/build-my.bat +++ b/build-my.bat @@ -1,7 +1,7 @@ @echo off -for /d %%f in (%~dp0My\*) do ( - call %%f\build.bat +for /d %%f in ("%~dp0My\*") do ( + if exist "%%f\build.bat" call "%%f\build.bat" if errorlevel 1 goto exit )