Visual interface for Harbour hbmk2.exe
Posted: Sun Mar 17, 2013 10:32 pm
Harbour provides a powerfull hbmk2.exe make utility but it is intended to be used from a console window, so I thought to provide a visual interface for it to turn it even simpler
This is a very early prototype but you may be interested in testing it, provide ideas, etc. thanks
vhb.prg
This is a very early prototype but you may be interested in testing it, provide ideas, etc. thanks
vhb.prg
Code: Select all
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function BuildWindow()
local oDlg, oGet1, cPrgName := Space( 20 ), oSay3, oFld1, oSay2, oBtn1, oBtn2
local cResult, oResult, cPath, nRetCode
SetDlgGradient( { { 1, RGB( 199, 216, 237 ), RGB( 237, 242, 248 ) } } )
DEFINE DIALOG oDlg TITLE "Visual make for Harbour" ;
SIZE 600, 500
@ 16, 16 SAY oSay2 PROMPT "Main PRG" SIZE 30, 9 PIXEL OF oDlg
@ 25, 16 GET oGet1 VAR cPrgName SIZE 120, 12 PIXEL OF oDlg ;
ACTION oGet1:VarPut( cGetFile( "*.prg" ) )
@ 50, 16 SAY oSay3 PROMPT "Additional" SIZE 30, 9 PIXEL OF oDlg
@ 60, 16 FOLDER oFld1 PROMPTS "PRGs", "OBJs", "LIBs" ;
SIZE 200, 100 PIXEL OF oDlg
@ 22, 230 BUTTON oBtn1 PROMPT "&Build" ;
SIZE 60, 20 PIXEL OF oDlg ;
ACTION ( MemoWrit( "go.bat", "set path=c:\bcc582\bin" + CRLF + ;
"c:\harbour\bin\hbmk2 " + ;
"-comp=bcc " + ;
"-ic:\fwteam\include " + ;
"-lfiveh.lib " + ;
"-lfivehc.lib " + ;
"-Lc:\fwteam\lib " + ;
"-lc:\bcc582\lib\psdk\psapi.lib " + ;
"xhb.hbc " + ;
"-gtgui " + ;
AllTrim( cPrgName ) ),;
nRetCode := WaitRun( "go.bat > out.log", 0 ),;
oResult:SetText( GetError( nRetCode ) + CRLF + MemoRead( "out.log" ) ),;
WaitRun( cFileNoExt( cPrgName ) ),;
hb_SetEnv( "path", cPath ) )
@ 48, 230 BUTTON oBtn2 PROMPT "&Cancel" ;
SIZE 60, 20 PIXEL OF oDlg ;
ACTION oDlg:End()
@ 170, 16 SAY oSay3 PROMPT "Result" SIZE 30, 9 PIXEL OF oDlg
@ 180, 16 GET oResult VAR cResult MEMO ;
SIZE 200, 60 PIXEL OF oDlg
ACTIVATE DIALOG oDlg CENTERED
return oDlg
//----------------------------------------------------------------------------//
function GetError( nError )
do case
case nError == 0
return "Ok"
case nError == 2
return "unknown compiler"
case nError == 6
return "failed in compilation (Harbour, C compiler, Resource compiler)"
case nError == 7
return "failed in final assembly (linker or library manager)"
endcase
return Str( nError )
//----------------------------------------------------------------------------//