@echo off

rem on local zone for fake-global vars
Setlocal EnableDelayedExpansion

rem cd must have a left-slash
if not "%cd:~-1%"=="\" set "cd=%cd%\"

rem make sources list for cpp files
set srcdir=%cd%src/
cd src
set files=
for /f delims^= %%i in ('dir /b /s /a-d *.cpp') do (
set file=%%i
set files=!files! !file!
)
cd ..

rem hack
set path=C:\Borland\BCC55\Bin;%path%
rem output program name
set exename=Program
rem tshh! top secret!
set outdir=%cd%tobj\

rem del /Q tobj

bcc32 -n%outdir% -e%exename% -y %files%

move %outdir%%exename%.exe %exename%.exe

pause