Executable convertion moved out to a separate file, manual “Bin\convert.bat” added

This commit is contained in:
Владислав Джавадов 2020-05-31 21:55:55 +03:00
parent a9f98b9894
commit 7add2ddf38
2 changed files with 22 additions and 5 deletions

View File

@ -18,16 +18,17 @@ if exist "%Source%.cfg" del "%Source%.cfg"
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..\Lib\convert.bat %%* >"%Bin%\convert.bat"
if errorlevel 1 goto exit
)
dcc32 "%Source%.dpr" -e"%Bin%" -u"%Units%" %Options%
if errorlevel 1 goto exit
"%~dp0..\Pet" -nologo -strip -trunc -dropsect .idata,.rsrc -rebase 0 -osver 0.7 -log brief -into "%Target%.exe"
call "%~dp0convert.bat" "%Target%.exe"
if errorlevel 1 goto exit
"%~dp0..\exe2kos" "%Target%.exe" "%Target%"
if errorlevel 1 goto exit
del "%Target%.exe"
%~dp0..\kpack "%Target%"
:exit

16
Lib/convert.bat Normal file
View File

@ -0,0 +1,16 @@
@echo off
if "%1"=="" (
echo Usage: %~n0 [source-file.exe [pet-options]]
goto exit
)
"%~dp0..\Pet" -nologo -strip -trunc -dropsect .idata,.rsrc -rebase 0 -osver 0.7 -log brief -into %*
if errorlevel 1 goto exit
"%~dp0..\exe2kos" "%1"
if errorlevel 1 goto exit
%~dp0..\kpack "%~dp1%~n1"
:exit