FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Compiling using hbmk2
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Compiling using hbmk2
Posted: Thu Jul 21, 2011 05:21 AM
Steps I did to allow me to compile fwh\samples using hbmk2

i. Ensure there's only 1 C compiler along my path and it's the one I want to use. Add harbour's path too.
ii. Copy fwh.hbc below to the root of FWH (modified from fwh.hbc found at harbour\utils\hbmk2\examples)
Code (fw): Select all Collapse
#
# $Id: fwh.hbc 11227 2009-06-05 16:55:43Z vszakats $
#

# Copy this file to FWH root dir and include it in hbmk2
# command line to build an app:
# > hbmk2 test.prg C:\fwh\fwh.hbc

xhb.hbc
{win}incpaths=include
{win}libpaths=lib

{win}gt=gtgui


{msvc}libs=fivehm fivehcm xhb
{allmingw}libs=fivehg fivehgc xhb
{bcc}libs=fiveh fivehc xhb

{win}libs=comctl32
{win}libs=comdlg32
{win}libs=gdi32
{win}libs=hbcplr
{win}libs=hbct
{win}libs=hbmzip
{win}libs=hbpcre
{win}libs=hbsqlit3
{win}libs=hbtip
{win}libs=hbwin
{win}libs=hbzlib
{win}libs=msimg32
{win}libs=odbc32
{win}libs=ole32
{win}libs=oleaut32
{win}libs=user32
{win}libs=uuid
{win}libs=vfw32
{win}libs=winmm
{win}libs=winspool
{win}libs=wsock32


Note that the above .hbc doesn't contain harbour core libraries. Do not add it in as it's added by hbmk2 automatically.

iii. In fwh\samples, I created the following batch file, -.bat
Code (fw): Select all Collapse
hbmk2 %1 %2 %3 c:\fwh\fwh.hbc


So now at command prompt I just need to type:
>- invoice <Enter>

There. Now if I were to change my C compiler, the only thing I should need to do is adjusting the path to the C compiler that I want to use.
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour
Posts: 1096
Joined: Fri Oct 28, 2005 02:27 AM
Re: Compiling using hbmk2
Posted: Thu Jul 21, 2011 06:56 AM
Here's how I build my private library by using hbmk2.

i. Create a mylib.hbp
Code (fw): Select all Collapse
-n
-omylib
-hblib
-ic:\fwh\include;c:\harbour\include
xhb.hbc

a.prg
b.c
c.prg


So later I just do:
>hbmk2 mylib.hbp

I guess a lot of improvement could still be done to how I configure things as I'm still new with using hbmk2
FWH 11.08/FWH 19.12

BCC5.82/BCC7.3

xHarbour/Harbour

Continue the discussion