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-06-28 20:57:52 +02:00
|
|
|
set DCU=%~dp0..\Bin\DCU
|
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%"
|
2020-06-28 20:57:52 +02:00
|
|
|
if not exist "%DCU%" mkdir "%DCU%"
|
2020-05-22 00:15:03 +02:00
|
|
|
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" (
|
2020-06-28 20:32:30 +02:00
|
|
|
echo @%%~dp0..\Tools\convert.bat %%* >"%Bin%\convert.bat"
|
2020-05-31 20:55:55 +02:00
|
|
|
if errorlevel 1 goto exit
|
|
|
|
)
|
|
|
|
|
2020-06-28 20:57:52 +02:00
|
|
|
dcc32 "%Source%.dpr" -e"%Bin%" -n"%DCU%" -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
|