2009-05-18 15:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* utils/hbmk2/hbmk2.prg
    + Added experimental support for multitarget command lines.
      The final usage may be changed.
      There are two ways to do multitarget hbmk2 sessions:
      1.) hbmk2 [<common_params1>] target1.hbt [<common_params2>] target2.hbt [<common_params3>]
          where .hbt is an .hbm file just with an .hbt extension.
          Examples:
             hbmk2 mylib1.hbt mylib2.hbt myapp.hbt
             hbmk2 -trace -pause mylib1.hbt mylib2.hbt myapp.hbt -beep
      2.) hbmk2 [<common_params1>] -target <target1_params> -target <target2_params> [-notarget <common_params2>]
          Examples:
             hbmk2 -target hello1.prg -target hello2.prg
             hbmk2 -trace -target hello1.prg -target hello2.prg
             hbmk2 -trace -target hello1.prg -target hello2.prg -notarget -beep
    ! Fixed not expanding wildcards in .hbm files on *nix systems.

  * contrib/xhb/xhbcomp.prg
    * Minor formatting.
This commit is contained in:
Viktor Szakats
2009-05-18 14:08:27 +00:00
parent b1cc3b1ef5
commit 8ed466ec6d
3 changed files with 93 additions and 19 deletions

View File

@@ -17,6 +17,26 @@
past entries belonging to these authors: Viktor Szakats.
*/
2009-05-18 15:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* utils/hbmk2/hbmk2.prg
+ Added experimental support for multitarget command lines.
The final usage may be changed.
There are two ways to do multitarget hbmk2 sessions:
1.) hbmk2 [<common_params1>] target1.hbt [<common_params2>] target2.hbt [<common_params3>]
where .hbt is an .hbm file just with an .hbt extension.
Examples:
hbmk2 mylib1.hbt mylib2.hbt myapp.hbt
hbmk2 -trace -pause mylib1.hbt mylib2.hbt myapp.hbt -beep
2.) hbmk2 [<common_params1>] -target <target1_params> -target <target2_params> [-notarget <common_params2>]
Examples:
hbmk2 -target hello1.prg -target hello2.prg
hbmk2 -trace -target hello1.prg -target hello2.prg
hbmk2 -trace -target hello1.prg -target hello2.prg -notarget -beep
! Fixed not expanding wildcards in .hbm files on *nix systems.
* contrib/xhb/xhbcomp.prg
* Minor formatting.
2009-05-18 11:33 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/itemapi.c
* removed some old BCC hacks. They do not resolve possible problem

View File

@@ -60,9 +60,9 @@ ANNOUNCE XHB_LIB
* It should not be used in user code. [druzus]
*/
#xcommand OPTIONAL INHERIT <!className!> => ;
if type( <"className">+"()" ) == "UI" ;;
aadd( oClass:asSuper, @__<className>() ) ;;
end
IF Type( <"className">+"()" ) == "UI" ;;
AAdd( oClass:asSuper, @__<className>() ) ;;
ENDIF
INIT PROCEDURE xhb_Init()

View File

@@ -4,7 +4,7 @@
/*
* Harbour Project source code:
* Harbour Make
* Harbour Make (alias hbmk, alias hbmk2)
*
* Copyright 1999-2009 Viktor Szakats <harbour.01 syenar.hu>
* www - http://www.harbour-project.org
@@ -221,6 +221,11 @@ PROCEDURE Main( ... )
LOCAL lPause := hb_gtInfo( HB_GTI_ISGRAPHIC )
LOCAL aArgsTarget
LOCAL nTarget
LOCAL nTargetTODO
LOCAL lHadTarget
/* Emulate -hbcmp, -hbcc, -hblnk switches when certain
self names are detected.
For compatibility with hbmk script aliases. */
@@ -254,7 +259,49 @@ PROCEDURE Main( ... )
ENDCASE
ENDIF
nResult := hbmk( aArgs, @lPause )
/* Handle multitarget command lines */
nTargetTODO := 1
DO WHILE .T.
aArgsTarget := {}
nTarget := 0
lHadTarget := .F.
FOR EACH tmp IN aArgs
DO CASE
CASE Lower( FN_ExtGet( tmp ) ) == ".hbt" .AND. ! lHadTarget
nTarget++
IF nTarget == nTargetTODO
AAdd( aArgsTarget, tmp )
ENDIF
CASE Lower( tmp ) == "-target"
nTarget++
lHadTarget := .T.
CASE Lower( tmp ) == "-notarget"
lHadTarget := .F.
OTHERWISE
IF ! lHadTarget .OR. nTarget == nTargetTODO
AAdd( aArgsTarget, tmp )
ENDIF
ENDCASE
NEXT
/* Exit if there was no more projects found on the command line */
IF nTarget < nTargetTODO
EXIT
ENDIF
/* Build one target */
nResult := hbmk( aArgsTarget, @lPause )
/* Exit on first failure */
IF nResult != 0
EXIT
ENDIF
nTargetTODO++
ENDDO
IF nResult != 0 .AND. lPause
OutStd( I_( "Press any key to continue..." ) )
@@ -1051,7 +1098,8 @@ FUNCTION hbmk( aArgs, /* @ */ lPause )
nEmbedLevel := 1
HBM_Load( aParams, cParam, @nEmbedLevel ) /* Load parameters from script file */
ENDIF
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm"
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm" .OR. ;
Lower( FN_ExtGet( cParam ) ) == ".hbt"
nEmbedLevel := 1
HBM_Load( aParams, cParam, @nEmbedLevel ) /* Load parameters from script file */
OTHERWISE
@@ -1464,14 +1512,14 @@ FUNCTION hbmk( aArgs, /* @ */ lPause )
CASE FN_ExtGet( cParamL ) == ".prg"
cParam := ArchCompFilter( hbmk, cParam )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ) )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
AAdd( s_aPRG , PathSepToTarget( hbmk, cParam ) )
DEFAULT s_cFIRST TO PathSepToSelf( cParam )
NEXT
CASE FN_ExtGet( cParamL ) == ".rc"
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ) )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
AAdd( s_aRESSRC , PathSepToTarget( hbmk, cParam ) )
NEXT
@@ -1481,11 +1529,11 @@ FUNCTION hbmk( aArgs, /* @ */ lPause )
/* For MinGW family add .res files as source input, as they
will need to be converted to coff format with windres (just
like plain .rc files) before feeding them to gcc. */
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ) )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
AAdd( s_aRESSRC , PathSepToTarget( hbmk, cParam ) )
NEXT
ELSE
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ) )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
AAdd( s_aRESCMP , PathSepToTarget( hbmk, cParam ) )
NEXT
ENDIF
@@ -1498,7 +1546,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause )
CASE FN_ExtGet( cParamL ) == ".o" .OR. ;
FN_ExtGet( cParamL ) == ".obj"
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ) )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
AAdd( s_aOBJUSER, PathSepToTarget( hbmk, cParam ) )
DEFAULT s_cFIRST TO PathSepToSelf( cParam )
NEXT
@@ -1507,7 +1555,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause )
FN_ExtGet( cParamL ) == ".cpp" /* .cc, .cxx, .cx */
cParam := ArchCompFilter( hbmk, cParam )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ) )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
AAdd( s_aC , PathSepToTarget( hbmk, cParam ) )
DEFAULT s_cFIRST TO PathSepToSelf( cParam )
NEXT
@@ -1515,7 +1563,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause )
CASE FN_ExtGet( cParamL ) $ ".po" .OR. ;
FN_ExtGet( cParamL ) $ ".pot"
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ) )
FOR EACH cParam IN FN_Expand( PathProc( cParam, aParam[ _PAR_cFileName ] ), Empty( aParam[ _PAR_cFileName ] ) )
AAdd( hbmk[ _HBMK_aPO ], PathSepToTarget( hbmk, cParam ) )
NEXT
@@ -4288,15 +4336,21 @@ STATIC FUNCTION FN_DirExtSet( cFileName, cDirNew, cExtNew )
RETURN hb_FNameMerge( cDir, cName, cExt )
STATIC FUNCTION FN_Expand( cFileName )
#if defined( __PLATFORM__UNIX )
RETURN { cFileName }
#else
STATIC FUNCTION FN_Expand( cFileName, lCommandLine )
LOCAL aFileList
LOCAL aFile
LOCAL aDir
LOCAL cExt
#if defined( __PLATFORM__UNIX )
/* Disable expansion if this came from the command line */
IF lCommandLine
RETURN { cFileName }
ENDIF
#else
HB_SYMBOL_UNUSED( lCommandLine )
#endif
IF ! FN_HasWildcard( cFileName )
RETURN { cFileName }
ENDIF
@@ -4312,7 +4366,6 @@ STATIC FUNCTION FN_Expand( cFileName )
NEXT
RETURN aFileList
#endif
STATIC FUNCTION FN_HasWildcard( cFileName )
RETURN "?" $ cFileName .OR. ;
@@ -4660,7 +4713,8 @@ STATIC PROCEDURE HBM_Load( aParams, cFileName, /* @ */ nEmbedLevel )
nEmbedLevel++
HBM_Load( aParams, PathProc( cParam, cFileName ), @nEmbedLevel ) /* Load parameters from script file */
ENDIF
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm"
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm" .OR. ;
Lower( FN_ExtGet( cParam ) ) == ".hbt"
IF nEmbedLevel < 3
nEmbedLevel++
HBM_Load( aParams, PathProc( cParam, cFileName ), @nEmbedLevel ) /* Load parameters from script file */