SDK/Tools/build.bat

34 lines
669 B
Batchfile
Raw Normal View History

2020-05-22 00:15:03 +02:00
@echo off
set Source=%1
2020-06-28 21:07:46 +02:00
if #%Source%#==## (
2020-05-22 00:15:03 +02:00
echo Usage: %~n0 [source-file]
goto exit
)
2021-01-08 16:39:17 +01:00
call "%~dp0init.bat" -dKolibriOS
2020-05-23 15:55:40 +02:00
set Bin=%~dp0..\Bin
set DCU=%Bin%\DCU
set Options=-$C- -$I- -$T+
2020-05-22 00:15:03 +02:00
set Target=%Bin%\%~n1
set Units=%~dp0..\Lib;%DCU%
2020-05-22 00:15:03 +02:00
if exist "%Source%.cfg" del "%Source%.cfg"
2021-01-08 16:39:17 +01:00
dcc32 -b %Source%.dpr -e"%Bin%" -n"%DCU%" -u"%Units%" %Options% -dKolibriOS
2020-05-22 00:15:03 +02:00
if errorlevel 1 goto exit
2021-01-08 16:39:17 +01:00
"%~dp0..\Pet" -nologo -strip -trunc -dropsect .idata,.rsrc -rebase 0 -osver 0.7 -log brief -into "%Target%.exe"
if errorlevel 1 goto exit
"%~dp0..\exe2kos" "%Target%.exe"
if errorlevel 1 goto exit
"%~dp0..\kpack" "%Target%"
2020-05-22 00:15:03 +02:00
if errorlevel 1 goto exit
del "%Target%.exe"
:exit