@echo off

echo %EXEPATH%\%PROJECT%.exe, + >> b32.bc
echo %PROJECT%.map, + >> b32.bc
echo ..\xharbour\lib\BCC640.LIB + >> b32.bc
echo ..\xharbour\lib\rtl.lib + >> b32.bc
echo ..\xharbour\lib\optgui.lib + >> b32.bc
echo ..\xharbour\lib\vm.lib + >> b32.bc
echo ..\xharbour\lib\gtwvt.lib + >> b32.bc
echo ..\xharbour\lib\gtwin.lib + >> b32.bc
echo ..\xharbour\lib\gtnul.lib + >> b32.bc
echo ..\xharbour\lib\lang.lib + >> b32.bc
echo ..\xharbour\lib\codepage.lib + >> b32.bc
echo ..\xharbour\lib\macro.lib + >> b32.bc
echo ..\xharbour\lib\rdd.lib + >> b32.bc
echo ..\xharbour\lib\dbfntx.lib + >> b32.bc
echo ..\xharbour\lib\dbfcdx.lib + >> b32.bc
echo ..\xharbour\lib\dbffpt.lib + >> b32.bc
echo ..\xharbour\lib\dbfdbt.lib + >> b32.bc
echo ..\xharbour\lib\common.lib + >> b32.bc
echo ..\xharbour\lib\debug.lib + >> b32.bc
echo ..\xharbour\lib\hbct.lib + >> b32.bc
rem XML + OpenOffice
echo ..\xharbour\lib\hbzip.lib + >> b32.bc
echo ..\xharbour\lib\hbxml.lib + >> b32.bc
rem ADS
rem echo ..\xharbour\lib\rddads.lib + >> b32.bc
rem echo ..\xharbour\lib\ace32.lib + >> b32.bc
echo ..\xharbour\lib\what32.lib + >> b32.bc
rem MySQL 4.1.x
rem echo ..\xharbour\lib\libmysql.lib + >> b32.bc
rem echo ..\xharbour\lib\mysql.lib + >> b32.bc

echo %LIB_NAME% + >> b32.bc
echo ..\bcc5\lib\cw32.lib + >> b32.bc
echo ..\bcc5\lib\import32.lib, >> b32.bc

if exist Best4.res echo Best4.res >> b32.bc

..\bcc5\bin\ilink32 -ap -Tpe -Gn @b32.bc >>h%PROJECT%.log
if errorlevel 1 goto ERR
@if exist %PROJECT%.map del %PROJECT%.map
@if exist %EXEPATH%\%PROJECT%.tds del %EXEPATH%\%PROJECT%.tds

if not exist %EXEPATH%\%PROJECT%.exe goto ERR
@if exist h%PROJECT%.log del h%PROJECT%.log
@if exist b32.bc del b32.bc
if (%2)==() goto  EXIT
CD ..
START %BINPATH%\%PROJECT%.exe %3
goto EXIT


:ERR
echo *** Žè¨¡ª¨ á¬. ¢ h%PROJECT%.log ***
if (%2)==() goto  EXIT
START NOTEPAD.exe h%PROJECT%.log
:EXIT
