Hola:
Como puedo incluir un archivo .cpp en un archivo bat para compilar ?
set hdir=c:\xharbour
set bcdir=c:\bcc55
set fwdir=c:\fwh
set lib=%xdir%\lib;%bcdir%\lib;%fwdir%\lib
set include=%xdir%\include;%bcdir%\include;%fwdir%\include
if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST
ECHO Compiling...
%hdir%\bin\harbour %1 /n /i%fwdir%\include;%hdir%\include /w /p %2 %3 > clip.log
%hdir%\bin\harbour btnget /n /i%fwdir%\include;%hdir%\include /w /p %2 %3 > clip.log
%hdir%\bin\harbour wbrowse /n /i%fwdir%\include;%hdir%\include /w /p %2 %3 > clip.log
%hdir%\bin\harbour tmultise /n /i%fwdir%\include;%hdir%\include /w /p %2 %3 > clip.log
%hdir%\bin\harbour pdf1 /n /i%fwdir%\include;%hdir%\include /w /p %2 %3 > clip.log
%hdir%\bin\harbour pdfhbdcs /n /i%fwdir%\include;%hdir%\include /w /p %2 %3 > clip.log
%hdir%\bin\harbour tFacturaElectronica /n /i%fwdir%\include;%hdir%\include /w /p %2 %3 > clip.log
@type clip.log
IF ERRORLEVEL 1 PAUSE
IF ERRORLEVEL 1 GOTO EXIT
rem echo -O2 -e%1.exe -I%hdir%\include %1.c > b32.bc
rem %bcdir%\bin\bcc32 -M -c -v @b32.bc
%bcdir%\bin\bcc32 -M -c -v -O2 -I%hdir%\include %1.c
%bcdir%\bin\bcc32 -M -c -v -O2 -I%hdir%\include %btnget.c
%bcdir%\bin\bcc32 -M -c -v -O2 -I%hdir%\include %wbrowse.c
%bcdir%\bin\bcc32 -M -c -v -O2 -I%hdir%\include %tmultise.c
%bcdir%\bin\bcc32 -M -c -v -O2 -I%hdir%\include %pdf1.c
%bcdir%\bin\bcc32 -M -c -v -O2 -I%hdir%\include %pdfhbdcs.c
%bcdir%\bin\bcc32 -M -c -v -O2 -I%hdir%\include %tFacturaElectronica.c
:ENDCOMPILE
IF EXIST %1.rc %bcdir%\bin\brc32 -r %1
echo c0w32.obj + > b32.bc
echo %1.obj btnget.obj wbrowse.obj tmultise.obj wbrwline.obj pdf1.obj pdfhbdcs.obj , + >> b32.bc
echo %1.exe, + >> b32.bc
echo %1.map, + >> b32.bc
echo %fwdir%\lib\Fivehx.lib %fwdir%\lib\FiveHC.lib + >> b32.bc
echo %hdir%\lib\rtl.lib + >> b32.bc
echo %hdir%\lib\hbzip.lib + >> b32.bc
echo %hdir%\lib\zlib.lib + >> b32.bc
echo %hdir%\lib\vm.lib + >> b32.bc
echo %hdir%\lib\gtgui.lib + >> b32.bc
echo %hdir%\lib\lang.lib + >> b32.bc
echo %hdir%\lib\macro.lib + >> b32.bc
echo %hdir%\lib\rdd.lib + >> b32.bc
echo %hdir%\lib\dbfntx.lib + >> b32.bc
echo %hdir%\lib\dbfcdx.lib + >> b32.bc
echo %hdir%\lib\dbffpt.lib + >> b32.bc
echo %hdir%\lib\hbsix.lib + >> b32.bc
echo %hdir%\lib\debug.lib + >> b32.bc
echo %hdir%\lib\common.lib + >> b32.bc
echo %hdir%\lib\pp.lib + >> b32.bc
echo %hdir%\lib\ct.lib + >> b32.bc
echo %hdir%\lib\pcrepos.lib + >> b32.bc
echo %hdir%\lib\btnget32.lib + >> b32.bc
echo %hdir%\lib\wbrowse.lib + >> b32.bc
echo %hdir%\lib\tpdfx.lib + >> b32.bc
echo %hdir%\lib\hbole.lib + >> b32.bc
rem Uncomment these two lines to use Advantage RDD
rem echo %hdir%\lib\rddads.lib + >> b32.bc
rem echo %hdir%\lib\Ace32.lib + >> b32.bc
echo %bcdir%\lib\cw32.lib + >> b32.bc
echo %bcdir%\lib\import32.lib + >> b32.bc
echo %bcdir%\lib\psdk\odbc32.lib + >> b32.bc
echo %bcdir%\lib\psdk\rasapi32.lib + >> b32.bc
echo %bcdir%\lib\psdk\nddeapi.lib + >> b32.bc
echo %bcdir%\lib\psdk\msimg32.lib + >> b32.bc
echo %bcdir%\lib\psdk\iphlpapi.lib, >> b32.bc
IF EXIST %1.res echo %1.res >> b32.bc
rem uncomment this line to use the debugger and comment the following one
rem %bcdir%\bin\ilink32 -Gn -Tpe -s -v @b32.bc
%bcdir%\bin\ilink32 -Gn -aa -Tpe -s -v @b32.bc
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built
%1
GOTO EXIT
ECHO
rem delete temporary files
@del %1.c
:LINKERROR
ECHO * There are errors
GOTO EXIT
:SINTAX
ECHO SYNTAX: Build [Program] {-- No especifiques la extensi¢n PRG
ECHO {-- Don't specify .PRG extension
GOTO EXIT
:NOEXIST
ECHO The specified PRG %1 does not exist
:EXIT