2020-05-22 00:15:03 +02:00
|
|
|
@echo off
|
|
|
|
|
|
|
|
set Source=%1
|
|
|
|
|
|
|
|
if "%Source%"=="" (
|
|
|
|
echo Usage: %~n0 [source-file]
|
|
|
|
goto exit
|
|
|
|
)
|
|
|
|
|
2020-05-23 15:55:40 +02:00
|
|
|
set Bin=%~dp0..\Bin
|
2020-05-31 19:58:17 +02:00
|
|
|
set Options=-$C- -$I- -$T+
|
2020-05-22 00:15:03 +02:00
|
|
|
set Target=%Bin%\%~n1
|
2020-05-23 15:55:40 +02:00
|
|
|
set Units=%~dp0..\RTL;%~dp0..\Lib
|
2020-05-22 00:15:03 +02:00
|
|
|
|
|
|
|
if not exist "%Bin%" mkdir "%Bin%"
|
|
|
|
if exist "%Source%.cfg" del "%Source%.cfg"
|
|
|
|
|
2020-05-31 19:58:17 +02:00
|
|
|
if not exist "%~dp0..\RTL\SysInit.dcu" call "%~dp0..\build-RTL.bat"
|
|
|
|
if errorlevel 1 goto exit
|
|
|
|
|
2020-05-31 20:55:55 +02:00
|
|
|
if not exist "%Bin%\convert.bat" (
|
|
|
|
echo @%%~dp0..\Lib\convert.bat %%* >"%Bin%\convert.bat"
|
|
|
|
if errorlevel 1 goto exit
|
|
|
|
)
|
|
|
|
|
2020-05-31 19:58:17 +02:00
|
|
|
dcc32 "%Source%.dpr" -e"%Bin%" -u"%Units%" %Options%
|
2020-05-22 00:15:03 +02:00
|
|
|
if errorlevel 1 goto exit
|
|
|
|
|
2020-05-31 20:55:55 +02:00
|
|
|
call "%~dp0convert.bat" "%Target%.exe"
|
2020-05-22 00:15:03 +02:00
|
|
|
if errorlevel 1 goto exit
|
|
|
|
|
|
|
|
del "%Target%.exe"
|
|
|
|
|
|
|
|
:exit
|