TIP: Script to compile Harbour + FWH + MSVC 2008 Express

TIP: Script to compile Harbour + FWH + MSVC 2008 Express

Postby vailtom » Wed Feb 25, 2009 8:34 pm

Many people here in Brazil are asked me about how to compile with FWH + HARBOUR + MSVC. I have adapted the script BUILDHM.BAT to perform this task, I hope it can help.

Code: Select all  Expand view
@ECHO OFF
CLS
ECHO ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
ECHO ³ FiveWin for Harbour 9.01 (MSVC++) Jan. 2009      Harbour development power ³Ü
ECHO ³ (c) FiveTech, 1993-2009     for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7 ³Û
ECHO ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
ECHO ÿ ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

REM ***
REM *** Adaptado para uso do FWH & MSVC Express 2008 por Vailton Renato
REM ***
call "%ProgramFiles%\Microsoft Visual Studio 9.0\VC\vcvarsall.bat" x86

if "%CC_DIR%"  == "" set CC_DIR=%ProgramFiles%\Microsoft Visual Studio 9.0\VC
if "%SDK_DIR%" == "" set SDK_DIR=%ProgramFiles%\Microsoft SDKs\Windows\v6.0A
if "%HBDIR%"   == "" set HBDIR=c:\harbour

ECHO Compiling...

if exist %HBDIR%\bin\harbour.exe    set hdir=%HBDIR%\bin
if exist %HBDIR%\bin\vc\harbour.exe set hdir=%HBDIR%\bin\vc

if exist %HBDIR%\lib\hbvm.lib       set hdirl=%HBDIR%\lib
if exist %HBDIR%\lib\vc\hbvm.lib    set hdirl=%HBDIR%\lib\vc

set include=%CC_DIR%\include;%HBDIR%\include;%include%
set lib=%CC_DIR%\lib;%SDK_DIR%\lib;%hdir%\lib;%lib%

"%hdir%\harbour" %1 /n /i..\include;%HBDIR%\include /w /p %2 %3 > comp.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
type comp.log

"%CC_DIR%\bin\cl" -TP -W3 -c /GA %1.c
:ENDCOMPILE

IF EXIST %1.rc "%SDK_DIR%\bin\rc" -r -d__FLAT__ %1

echo %1.obj  > msvc.tmp
echo ..\lib\FiveHM.lib ..\lib\FiveHCM.lib  >> msvc.tmp

echo "%hdirl%\hbrtl.lib"  >> msvc.tmp
echo "%hdirl%\hbvm.lib"  >> msvc.tmp
echo "%hdirl%\gtgui.lib"  >> msvc.tmp
echo "%hdirl%\hblang.lib"  >> msvc.tmp
echo "%hdirl%\hbmacro.lib"  >> msvc.tmp
echo "%hdirl%\hbrdd.lib"  >> msvc.tmp
echo "%hdirl%\rddntx.lib"  >> msvc.tmp
echo "%hdirl%\rddcdx.lib"  >> msvc.tmp
echo "%hdirl%\rddfpt.lib"  >> msvc.tmp
echo "%hdirl%\hbsix.lib"  >> msvc.tmp
echo "%hdirl%\hbdebug.lib"  >> msvc.tmp
echo "%hdirl%\hbcommon.lib"  >> msvc.tmp
echo "%hdirl%\hbpp.lib"  >> msvc.tmp
echo "%hdirl%\hbcpage.lib"  >> msvc.tmp
echo "%hdirl%\hbwin.lib"  >> msvc.tmp

rem Uncomment these two lines to use Advantage RDD
rem echo "%hdirl%\rddads.lib" >> msvc.tmp
rem echo "%hdirl%\ace32.lib" >> msvc.tmp

echo "%CC_DIR%\lib\libcmt.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\kernel32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\user32.lib"    >> msvc.tmp
echo "%SDK_DIR%\lib\gdi32.lib"     >> msvc.tmp
echo "%SDK_DIR%\lib\winspool.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\comctl32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\comdlg32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\advapi32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\shell32.lib"   >> msvc.tmp
echo "%SDK_DIR%\lib\ole32.lib"     >> msvc.tmp
echo "%SDK_DIR%\lib\oleaut32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\uuid.lib"      >> msvc.tmp
echo "%SDK_DIR%\lib\odbc32.lib"    >> msvc.tmp
echo "%SDK_DIR%\lib\odbccp32.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\iphlpapi.lib"  >> msvc.tmp
echo "%SDK_DIR%\lib\mpr.lib"       >> msvc.tmp
echo "%SDK_DIR%\lib\version.lib"   >> msvc.tmp
echo "%SDK_DIR%\lib\wsock32.lib"   >> msvc.tmp
echo "%SDK_DIR%\lib\msimg32.lib"   >> msvc.tmp

IF EXIST "%1.res" echo "%1.res" >> msvc.tmp

"%CC_DIR%\bin\link" @msvc.tmp /NODEFAULTLIB:LIBC.LIB /nologo /subsystem:windows /force:multiple /NODEFAULTLIB:libcmt

IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
%1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c
@del msvc.tmp

:COMPILEERROR
@type comp.log
ECHO * Compiling errors *
GOTO EXIT

:LINKERROR
ECHO * Linking 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


Sorry my english is bad.
Vailton Renato
User avatar
vailtom
 
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm

Re: TIP: Script to compile Harbour + FWH + MSVC 2008 Express

Postby Antonio Linares » Wed Feb 25, 2009 10:24 pm

Vailton,

Thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: TIP: Script to compile Harbour + FWH + MSVC 2008 Express

Postby Kleyber » Wed Feb 25, 2009 11:56 pm

Vailton,

Thanks so much :lol:

Regards,
Kleyber Derick

FWH / xHb / xDevStudio / SQLLIB
User avatar
Kleyber
 
Posts: 581
Joined: Tue Oct 11, 2005 11:28 am
Location: São Luiz, Brasil

Re: TIP: Script to compile Harbour + FWH + MSVC 2008 Express

Postby fafi » Mon Mar 02, 2009 3:10 pm

Mr. Vailton

How to compile more prg in your script ? I have 5 prgs :
1. Main.prg
2. Customer.prg
3. Invoice.prg
4. Reports.prg
5. Strudbf.prg

Thank's

Regards
Fafi
User avatar
fafi
 
Posts: 169
Joined: Mon Feb 25, 2008 2:42 am

Re: TIP: Script to compile Harbour + FWH + MSVC 2008 Express

Postby lailton.webmaster » Thu Mar 05, 2009 9:40 am

Fafi i think that you can make it...

Main.prg
inside of your PRG main.prg insert...

#include "customer.prg"
#include "invoice.prg"
#include "reports.prg"
#include "Strudbf.prg"

or you can change file created by vailtom.

cya
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm

Re: TIP: Script to compile Harbour + FWH + MSVC 2008 Express

Postby vailtom » Thu Mar 05, 2009 12:32 pm

You can also use the new utility hbmk2.exe to compile your code. He seems much more practical, but I have not finished testing with FWH...
Vailton Renato
User avatar
vailtom
 
Posts: 47
Joined: Thu Jan 05, 2006 6:56 pm

Re: TIP: Script to compile Harbour + FWH + MSVC 2008 Express

Postby lailton.webmaster » Thu Mar 05, 2009 7:17 pm

Vailtom hbmk2 is the same that hbmake [x]harbour ?

Thanks so much! :mrgreen:
lailton.webmaster
 
Posts: 603
Joined: Sun May 04, 2008 8:44 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 73 guests