From 9a20ef07d5350ae6bd9736295667c35f596c8ce9 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 3 Jun 2009 19:36:22 +0000 Subject: [PATCH] 2009-06-03 21:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg + Added feature to automatically process make script with the name hbmk.hbm if found in local directory. This will be processed before the first command line option. ! -quiet switch wasn't effective on embedded Harbour compiler command line displayed in case of error. --- harbour/ChangeLog | 9 +++++++++ harbour/utils/hbmk2/hbmk2.prg | 24 ++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9f931c7941..6a8c76d1e6 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,15 @@ past entries belonging to these authors: Viktor Szakats. */ +2009-06-03 21:33 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * utils/hbmk2/hbmk2.prg + + Added feature to automatically process make script + with the name hbmk.hbm if found in local directory. + This will be processed before the first command line + option. + ! -quiet switch wasn't effective on embedded Harbour + compiler command line displayed in case of error. + 2009-06-03 13:35 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * bin/postinst.bat ! Fixed import lib names for mingw where double 'lib' prefix diff --git a/harbour/utils/hbmk2/hbmk2.prg b/harbour/utils/hbmk2/hbmk2.prg index 3e760e564e..0b8fb8bc3a 100644 --- a/harbour/utils/hbmk2/hbmk2.prg +++ b/harbour/utils/hbmk2/hbmk2.prg @@ -163,6 +163,7 @@ REQUEST hbmk_KEYW #define _LNG_MARKER "${lng}" #define _HBMK_CFG_NAME "hbmk.cfg" +#define _HBMK_AUTOHBM_NAME "hbmk.hbm" #define _WORKDIR_BASE_ ".hbmk" #define _WORKDIR_DEF_ ( _WORKDIR_BASE_ + hb_osPathSeparator() + hbmk[ _HBMK_cARCH ] + hb_osPathSeparator() + hbmk[ _HBMK_cCOMP ] ) @@ -1200,8 +1201,18 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) hbmk[ _HBMK_aLNG ] := {} hbmk[ _HBMK_aINSTPATH ] := {} - /* Collect all command line parameters */ aParams := {} + + /* Process automatic make files in current dir. */ + IF hb_FileExists( _HBMK_AUTOHBM_NAME ) + IF ! hbmk[ _HBMK_lQuiet ] + hbmk_OutStd( hbmk, hb_StrFormat( I_( "Processing local make script: %1$s" ), _HBMK_AUTOHBM_NAME ) ) + ENDIF + nEmbedLevel := 1 + HBM_Load( hbmk, aParams, _HBMK_AUTOHBM_NAME, @nEmbedLevel ) + ENDIF + + /* Collect all command line parameters */ FOR EACH cParam IN aArgs DO CASE CASE ( Len( cParam ) >= 1 .AND. Left( cParam, 1 ) == "@" ) @@ -2902,8 +2913,10 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ELSE IF ( tmp := hb_compile( "", aCommand ) ) != 0 hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Running Harbour compiler. %1$s" ), hb_ntos( tmp ) ) ) - OutErr( DirAddPathSep( PathSepToSelf( s_cHB_BIN_INSTALL ) ) + cBin_CompPRG + cBinExt +; - " " + ArrayToList( aCommand ) + hb_osNewLine() ) + IF ! hbmk[ _HBMK_lQuiet ] + OutErr( DirAddPathSep( PathSepToSelf( s_cHB_BIN_INSTALL ) ) + cBin_CompPRG + cBinExt +; + " " + ArrayToList( aCommand ) + hb_osNewLine() ) + ENDIF IF s_lBEEP DoBeep( hbmk, .F. ) ENDIF @@ -2922,7 +2935,9 @@ FUNCTION hbmk( aArgs, /* @ */ lPause, /* @ */ lUTF8 ) ELSE hbmk_OutErr( hbmk, hb_StrFormat( I_( "Error: Running Harbour compiler. %1$s" ), hb_ntos( tmp ) ) ) ENDIF - OutErr( ArrayToList( thread[ 2 ] ) + hb_osNewLine() ) + IF ! hbmk[ _HBMK_lQuiet ] + OutErr( ArrayToList( thread[ 2 ] ) + hb_osNewLine() ) + ENDIF IF s_lBEEP DoBeep( hbmk, .F. ) ENDIF @@ -5983,6 +5998,7 @@ STATIC PROCEDURE ShowHelp( hbmk, lLong ) I_( "Multiple -l, -L and