2009-05-24 13:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* utils/hbmk2/hbmk2.prg
    * Changed multitarget support. Instead of special .hbt extension
      (which was not removed), not -target=<target>[.hbm|.prg] option
      can be used to force a distinct target from the command line.
      This way it's more flexible, easy to use and clear without needing
      a special extension alias.

      Here's the updated usage:
      There are two ways to do multitarget hbmk2 sessions:
      1.) hbmk2 [<common_params1>] -target=target1[.hbm|.prg] [<common_params2>] -target=target2[.hbm|.prg] [<common_params3>]
          Examples:
             hbmk2 -target=prog1 -target=prog2 -target=prog3
             hbmk2 -target=prog1.prg -target=prog2.prg -target=prog3.prg
             hbmk2 -target=mylib1.hbm -target=mylib2.hbm -target=myapp.hbm
             hbmk2 -trace -pause -target=mylib1.hbm -target=mylib2.hbm -target=myapp.hbm -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

    * Changed ' = ' operators to macro LEFTEQUAL().
    + Added Set( _SET_EXACT ) setting to make sure above operator
      works regardless of caller/default state.
    ; NOTE: IMO it would be useful to add a pseudo function
            equivalent to non-exact equality operator. This would
            clear up hacks like above.

  * doc/dirstruc.txt
    ! Typo.
This commit is contained in:
Viktor Szakats
2009-05-24 11:33:29 +00:00
parent ddf08a2b2a
commit cb560a9814
3 changed files with 57 additions and 20 deletions

View File

@@ -17,6 +17,38 @@
past entries belonging to these authors: Viktor Szakats.
*/
2009-05-24 13:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* utils/hbmk2/hbmk2.prg
* Changed multitarget support. Instead of special .hbt extension
(which was not removed), not -target=<target>[.hbm|.prg] option
can be used to force a distinct target from the command line.
This way it's more flexible, easy to use and clear without needing
a special extension alias.
Here's the updated usage:
There are two ways to do multitarget hbmk2 sessions:
1.) hbmk2 [<common_params1>] -target=target1[.hbm|.prg] [<common_params2>] -target=target2[.hbm|.prg] [<common_params3>]
Examples:
hbmk2 -target=prog1 -target=prog2 -target=prog3
hbmk2 -target=prog1.prg -target=prog2.prg -target=prog3.prg
hbmk2 -target=mylib1.hbm -target=mylib2.hbm -target=myapp.hbm
hbmk2 -trace -pause -target=mylib1.hbm -target=mylib2.hbm -target=myapp.hbm -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
* Changed ' = ' operators to macro LEFTEQUAL().
+ Added Set( _SET_EXACT ) setting to make sure above operator
works regardless of caller/default state.
; NOTE: IMO it would be useful to add a pseudo function
equivalent to non-exact equality operator. This would
clear up hacks like above.
* doc/dirstruc.txt
! Typo.
2009-05-24 11:52 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* INSTALL
* Terminology cleanup: x64 -> x86-64

View File

@@ -392,7 +392,7 @@ track of all files (read the FAQ if you don't know what SVN is).
|
+---hbextern - hbextern.ch generator.
|
+---hbi18n - Harbour i18n .pot/.hbl file manger.
+---hbi18n - Harbour i18n .pot/.hbl file manager.
|
+---hbmk - Harbour Make utility.
| |

View File

@@ -162,6 +162,9 @@ REQUEST hbmk_KEYW
#define OutStd( x ) low_OutStd( hbmk[ _HBMK_lUTF8 ], x )
#define OutErr( x ) low_OutErr( hbmk[ _HBMK_lUTF8 ], x )
/* This requires Set( _SET_EXACT, .F. ) */
#define LEFTEQUAL( l, r ) ( l = r )
#define _HBMK_lQuiet 1
#define _HBMK_lInfo 2
#define _HBMK_cARCH 3
@@ -235,6 +238,8 @@ PROCEDURE Main( ... )
LOCAL nTargetTODO
LOCAL lHadTarget
LOCAL lOldExact := Set( _SET_EXACT, .F. )
/* Emulate -hbcmp, -hbcc, -hblnk switches when certain
self names are detected.
For compatibility with hbmk script aliases. */
@@ -279,10 +284,10 @@ PROCEDURE Main( ... )
FOR EACH tmp IN aArgs
DO CASE
CASE Lower( FN_ExtGet( tmp ) ) == ".hbt" .AND. ! lHadTarget
CASE Lower( Left( tmp, Len( "-target=" ) ) ) == "-target="
nTarget++
IF nTarget == nTargetTODO
AAdd( aArgsTarget, tmp )
AAdd( aArgsTarget, SubStr( tmp, Len( "-target=" ) + 1 ) )
ENDIF
CASE Lower( tmp ) == "-target"
nTarget++
@@ -319,6 +324,8 @@ PROCEDURE Main( ... )
ErrorLevel( nResult )
Set( _SET_EXACT, lOldExact )
RETURN
STATIC FUNCTION hbmk_run( cCmd )
@@ -1140,8 +1147,7 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 )
nEmbedLevel := 1
HBM_Load( hbmk, aParams, cParam, @nEmbedLevel ) /* Load parameters from script file */
ENDIF
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm" .OR. ;
Lower( FN_ExtGet( cParam ) ) == ".hbt"
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm"
nEmbedLevel := 1
HBM_Load( hbmk, aParams, cParam, @nEmbedLevel ) /* Load parameters from script file */
OTHERWISE
@@ -4751,8 +4757,7 @@ STATIC PROCEDURE HBM_Load( hbmk, aParams, cFileName, /* @ */ nEmbedLevel )
nEmbedLevel++
HBM_Load( hbmk, aParams, PathProc( cParam, cFileName ), @nEmbedLevel ) /* Load parameters from script file */
ENDIF
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm" .OR. ;
Lower( FN_ExtGet( cParam ) ) == ".hbt"
CASE Lower( FN_ExtGet( cParam ) ) == ".hbm"
IF nEmbedLevel < 3
nEmbedLevel++
HBM_Load( hbmk, aParams, PathProc( cParam, cFileName ), @nEmbedLevel ) /* Load parameters from script file */
@@ -4906,7 +4911,7 @@ STATIC FUNCTION getFirstFunc( hbmk, cFile )
IF cExt == ".c"
FOR EACH cLine IN hb_ATokens( StrTran( hb_MemoRead( cFile ), Chr( 13 ), Chr( 10 ) ), Chr( 10 ) )
cLine := AllTrim( cLine )
IF cLine = '{ "' .AND. "HB_FS_FIRST" $ cLine
IF LEFTEQUAL( cLine, '{ "' ) .AND. "HB_FS_FIRST" $ cLine
n := 4
DO WHILE ( c := SubStr( cLine, n++, 1 ) ) != '"'
cFuncName += c
@@ -4918,7 +4923,7 @@ STATIC FUNCTION getFirstFunc( hbmk, cFile )
cFuncList := commandResult( hbmk, cExecNM + " " + cFile + " -g -n --defined-only -C" )
IF ( n := At( " T HB_FUN_", cFuncList ) ) != 0
n += 10
DO WHILE ( c := SubStr( cFuncList, n++, 1 ) ) = "_" .OR. ;
DO WHILE ( c := SubStr( cFuncList, n++, 1 ) ) == "_" .OR. ;
IsDigit( c ) .OR. IsAlpha( c )
cFuncName += c
ENDDO
@@ -5176,13 +5181,13 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ;
ENDIF
FOR EACH cLine IN hb_ATokens( cCommands, Chr( 10 ) )
cLine := AllTrim( cLine )
IF !Empty( cLine ) .AND. !cLine = "#" .AND. !cLine = "//"
IF !Empty( cLine ) .AND. ! LEFTEQUAL( cLine, "#" ) .AND. ! LEFTEQUAL( cLine, "//" )
IF nMode == RTLNK_MODE_NONE
/* blinker extension */
IF Upper( cLine ) = "ECHO "
IF LEFTEQUAL( Upper( cLine ), "ECHO " )
hbmk_OutStd( hbmk, hb_StrFormat( I_( "Blinker ECHO: %1$s" ), SubStr( cLine, 6 ) ) )
LOOP
ELSEIF Upper( cLine ) = "BLINKER "
ELSEIF LEFTEQUAL( Upper( cLine ), "BLINKER " )
/* skip blinker commands */
LOOP
ELSE /* TODO: add other blinker commands */
@@ -5216,7 +5221,7 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ;
ELSEIF nMode == RTLNK_MODE_SKIPNEXT
nMode := RTLNK_MODE_SKIP
ENDIF
ELSEIF cWord = "@"
ELSEIF LEFTEQUAL( cWord, "@" )
cWord := SubStr( cWord, 2 )
cCommands := rtlnk_read( @cWord, aPrevFiles )
IF cCommands == NIL
@@ -5230,16 +5235,16 @@ STATIC FUNCTION rtlnk_process( hbmk, cCommands, cFileOut, aFileList, aLibList, ;
ELSE
cWord := Upper( cWord )
IF Len( cWord ) >= 2
IF "OUTPUT" = cWord
IF LEFTEQUAL( "OUTPUT", cWord )
nMode := RTLNK_MODE_OUT
ELSEIF "FILE" = cWord
ELSEIF LEFTEQUAL( "FILE", cWord )
nMode := RTLNK_MODE_FILE
ELSEIF "LIBRARY" = cWord
ELSEIF LEFTEQUAL( "LIBRARY", cWord )
nMode := RTLNK_MODE_LIB
ELSEIF "MODULE" = cWord .OR. ;
"EXCLUDE" = cWord .OR. ;
"REFER" = cWord .OR. ;
"INTO" = cWord
ELSEIF LEFTEQUAL( "MODULE", cWord ) .OR. ;
LEFTEQUAL( "EXCLUDE", cWord ) .OR. ;
LEFTEQUAL( "REFER", cWord ) .OR. ;
LEFTEQUAL( "INTO", cWord )
nMode := RTLNK_MODE_SKIP
ENDIF
ENDIF