2009-10-15 17:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/rdd/dbfcdx/dbfcdx1.c
* removed old unused macros
* harbour/include/hbcompdf.h
* harbour/src/compiler/hbmain.c
* harbour/src/compiler/cmdcheck.c
* harbour/src/compiler/complex.c
* harbour/src/compiler/hbcomp.c
* harbour/src/compiler/gencobj.c
* harbour/src/compiler/hbusage.c
+ added support for -gd[.<destExt>] switch.
When used Harbour compiler generates also .d file with dependencies
list in the form like for make systems:
<destFile>: <sourceFiles,...>
optional .<destExt> parameter value can be used to replace default
extension in <destFile>.
Now users can generate .d files without additional overhead in the
same pass as normal compilation by simple adding -gd[.<destExt>]
switch to compilation command instead of executing harbour compiler
second time with -sm switch.
* harbour/doc/man/harbour.1
* updated man page
* harbour/utils/hbmk2/hbmk2.prg
* removed -kj switch - it's not longer necessary to improve -sm
* minor formatting
This commit is contained in:
@@ -17,6 +17,35 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2009-10-15 17:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/src/rdd/dbfcdx/dbfcdx1.c
|
||||
* removed old unused macros
|
||||
|
||||
* harbour/include/hbcompdf.h
|
||||
* harbour/src/compiler/hbmain.c
|
||||
* harbour/src/compiler/cmdcheck.c
|
||||
* harbour/src/compiler/complex.c
|
||||
* harbour/src/compiler/hbcomp.c
|
||||
* harbour/src/compiler/gencobj.c
|
||||
* harbour/src/compiler/hbusage.c
|
||||
+ added support for -gd[.<destExt>] switch.
|
||||
When used Harbour compiler generates also .d file with dependencies
|
||||
list in the form like for make systems:
|
||||
<destFile>: <sourceFiles,...>
|
||||
optional .<destExt> parameter value can be used to replace default
|
||||
extension in <destFile>.
|
||||
Now users can generate .d files without additional overhead in the
|
||||
same pass as normal compilation by simple adding -gd[.<destExt>]
|
||||
switch to compilation command instead of executing harbour compiler
|
||||
second time with -sm switch.
|
||||
|
||||
* harbour/doc/man/harbour.1
|
||||
* updated man page
|
||||
|
||||
* harbour/utils/hbmk2/hbmk2.prg
|
||||
* removed -kj switch - it's not longer necessary to improve -sm
|
||||
* minor formatting
|
||||
|
||||
2009-10-15 15:55 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* src/common/hbgete.c
|
||||
* src/rtl/filesys.c
|
||||
|
||||
@@ -27,15 +27,15 @@ output type generated is <type> (see below)
|
||||
.IP "\fB-gc[<type>]\fP" 10
|
||||
output type: C source (.c) (default)
|
||||
.IP
|
||||
<type>: 0=compact 1=normal 2=verbose (default)
|
||||
<type>: 0=compact (default) 1=normal 2=verbose
|
||||
.IP
|
||||
3=generate real C code instead of PCODE
|
||||
.IP "\fB-go\fP" 10
|
||||
output type: Platform dependant object module
|
||||
.IP "\fB-gw\fP" 10
|
||||
output type: Windows/DOS OBJ32 (.obj)
|
||||
.IP "\fB-gh\fP" 10
|
||||
output type: Harbour Portable Object (.hrb)
|
||||
.IP "\fB-gd[.<destext>]\fP" 10
|
||||
generate dependencies list into (.d) file
|
||||
.IP "\fB-i<path>\fP" 10
|
||||
#include file search path
|
||||
.IP "\fB-j[<file>]\fP" 10
|
||||
@@ -62,10 +62,12 @@ generate pre-processor trace (.ppt) file
|
||||
quiet
|
||||
.IP "\fB-q0\fP" 10
|
||||
quiet and don't display program header
|
||||
.IP "\fB-q2\fP" 10
|
||||
disable all output messages
|
||||
.IP "\fB-r=<max>\fP" 10
|
||||
set maximum number of preprocessor iterations
|
||||
.IP "\fB-s[m]\fP" 10
|
||||
syntax check only [and generate dependencies list]
|
||||
syntax check only [minimal for dependencies list]
|
||||
.IP "\fB-u[<file>]\fP" 10
|
||||
use command def set in <file> (or none)
|
||||
.IP "\fB-u+<file>\fP" 10
|
||||
|
||||
@@ -678,6 +678,7 @@ typedef struct _HB_COMP
|
||||
const char * szDeclaredFun;
|
||||
const char * szFile; /* Source file name of compiled module */
|
||||
char szPrefix[ 20 ]; /* holds the prefix added to the generated symbol init function name (in C output currently) */
|
||||
char * szDepExt; /* destination file extension used in decencies list */
|
||||
char * szStdCh; /* standard definitions file name (-u) */
|
||||
char ** szStdChExt; /* extended definitions file names (-u+<file>) */
|
||||
int iStdChExt; /* number of extended definition files (-u+<file>) */
|
||||
@@ -698,6 +699,7 @@ typedef struct _HB_COMP
|
||||
int iGenCOutput; /* C code generation should be verbose (use comments) or not */
|
||||
int ilastLineErr; /* line numer with last syntax error */
|
||||
int iTraceInclude; /* trace included files and generate dependencies list */
|
||||
int iSyntaxCheckOnly; /* syntax check only */
|
||||
|
||||
BOOL fQuiet; /* be quiet during compilation (-q) */
|
||||
BOOL fFullQuiet; /* be quiet during compilation disable all messages */
|
||||
@@ -713,7 +715,6 @@ typedef struct _HB_COMP
|
||||
BOOL fCredits; /* print credits */
|
||||
BOOL fBuildInfo; /* print build info */
|
||||
BOOL fLogo; /* print logo */
|
||||
BOOL fSyntaxCheckOnly; /* syntax check only */
|
||||
BOOL fLongOptimize; /* optimize PCODEs generated for integers */
|
||||
BOOL fSingleModule; /* do not automatically compile DO...[WITH...] external modules (-m) */
|
||||
BOOL fError; /* error appeared during compilation */
|
||||
|
||||
@@ -283,6 +283,25 @@ static void hb_compChkEnvironVar( HB_COMP_DECL, const char *szSwitch )
|
||||
HB_COMP_PARAM->iLanguage = HB_LANG_PORT_OBJ;
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
case 'D':
|
||||
if( HB_COMP_PARAM->szDepExt )
|
||||
{
|
||||
hb_xfree( HB_COMP_PARAM->szDepExt );
|
||||
HB_COMP_PARAM->szDepExt = NULL;
|
||||
}
|
||||
if( s[2] == '-' )
|
||||
HB_COMP_PARAM->iTraceInclude = 0;
|
||||
else if( s[2] == '.' || s[2] == '\0' )
|
||||
{
|
||||
HB_COMP_PARAM->iTraceInclude = 2;
|
||||
if( s[2] != '\0' )
|
||||
HB_COMP_PARAM->szDepExt = hb_strdup( s + 2 );
|
||||
}
|
||||
else
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'F', HB_COMP_ERR_BADOPTION, s, NULL );
|
||||
break;
|
||||
|
||||
#ifdef HB_GEN_OBJ32
|
||||
case 'w':
|
||||
case 'W':
|
||||
@@ -540,22 +559,16 @@ static void hb_compChkEnvironVar( HB_COMP_DECL, const char *szSwitch )
|
||||
switch( *( s + 1 ) )
|
||||
{
|
||||
case '\0':
|
||||
HB_COMP_PARAM->fSyntaxCheckOnly = TRUE;
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly = 1;
|
||||
break;
|
||||
case '-':
|
||||
HB_COMP_PARAM->fSyntaxCheckOnly = FALSE;
|
||||
HB_COMP_PARAM->iTraceInclude = 0;
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly = 0;
|
||||
break;
|
||||
case 'm':
|
||||
case 'M':
|
||||
if( s[2] == '-' || s[2]=='0' )
|
||||
if( s[2] == '\0' )
|
||||
{
|
||||
HB_COMP_PARAM->iTraceInclude = 0;
|
||||
break;
|
||||
}
|
||||
else if( s[2] == '\0' || s[2] == '1' )
|
||||
{
|
||||
HB_COMP_PARAM->iTraceInclude = 1;
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly = 2;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@@ -816,27 +829,36 @@ void hb_compChkCompilerSwitch( HB_COMP_DECL, int iArg, const char * const Args[]
|
||||
|
||||
case 'g':
|
||||
case 'G':
|
||||
/* Required argument */
|
||||
Switch[2] = szSwitch[j + 1];
|
||||
if( Switch[2] )
|
||||
if( szSwitch[j + 1] == 'd' || szSwitch[j + 1] == 'D' )
|
||||
{
|
||||
if( HB_ISDIGIT( szSwitch[j + 2] ) )
|
||||
{
|
||||
/* Optional argument */
|
||||
Switch[3] = szSwitch[j + 2];
|
||||
Switch[4] = '\0';
|
||||
j += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No optional argument */
|
||||
Switch[3] = '\0';
|
||||
j += 2;
|
||||
}
|
||||
hb_compChkEnvironVar( HB_COMP_PARAM, Switch );
|
||||
szSwitch += ( j - 1 );
|
||||
hb_compChkEnvironVar( HB_COMP_PARAM, szSwitch );
|
||||
j = strlen( szSwitch );
|
||||
}
|
||||
else
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'F', HB_COMP_ERR_BADOPTION, Switch, NULL );
|
||||
{
|
||||
/* Required argument */
|
||||
Switch[2] = szSwitch[j + 1];
|
||||
if( Switch[2] )
|
||||
{
|
||||
if( HB_ISDIGIT( szSwitch[j + 2] ) )
|
||||
{
|
||||
/* Optional argument */
|
||||
Switch[3] = szSwitch[j + 2];
|
||||
Switch[4] = '\0';
|
||||
j += 3;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No optional argument */
|
||||
Switch[3] = '\0';
|
||||
j += 2;
|
||||
}
|
||||
hb_compChkEnvironVar( HB_COMP_PARAM, Switch );
|
||||
}
|
||||
else
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'F', HB_COMP_ERR_BADOPTION, Switch, NULL );
|
||||
}
|
||||
continue;
|
||||
|
||||
case 'i':
|
||||
|
||||
@@ -829,7 +829,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
hb_strnicmp( "SEQUENCE", pToken->pNext->value, pToken->pNext->len ) == 0 )
|
||||
{
|
||||
if( HB_COMP_PARAM->functions.pLast->wSeqCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_ENDIF, NULL, NULL );
|
||||
hb_pp_tokenGet( pLex->pPP );
|
||||
@@ -871,7 +871,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
}
|
||||
/* Clipper accepts ELSE in one context only */
|
||||
if( HB_COMP_PARAM->functions.pLast->wIfCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_UNMATCHED_ELSE, NULL, NULL );
|
||||
pLex->iState = ELSE;
|
||||
@@ -890,7 +890,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
}
|
||||
/* Clipper accepts ELSEIF in one context only */
|
||||
if( HB_COMP_PARAM->functions.pLast->wIfCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_UNMATCHED_ELSEIF, NULL, NULL );
|
||||
pLex->iState = ELSEIF;
|
||||
@@ -908,7 +908,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
}
|
||||
/* Clipper accepts ENDIF in one context only */
|
||||
if( HB_COMP_PARAM->functions.pLast->wIfCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_ENDIF, NULL, NULL );
|
||||
break;
|
||||
@@ -925,7 +925,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
}
|
||||
/* Clipper accepts ENDCASE in one context only */
|
||||
if( HB_COMP_PARAM->functions.pLast->wCaseCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_ENDCASE, NULL, NULL );
|
||||
break;
|
||||
@@ -942,7 +942,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
}
|
||||
/* Clipper accepts ENDDO in one context only */
|
||||
if( HB_COMP_PARAM->functions.pLast->wWhileCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_ENDDO, NULL, NULL );
|
||||
break;
|
||||
@@ -1005,7 +1005,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
{
|
||||
if( HB_COMP_PARAM->functions.pLast->wCaseCounter == 0 &&
|
||||
HB_COMP_PARAM->functions.pLast->wSwitchCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_CASE, NULL, NULL );
|
||||
pLex->iState = iType;
|
||||
@@ -1044,7 +1044,7 @@ int hb_complex( YYSTYPE *yylval_ptr, HB_COMP_DECL )
|
||||
HB_PP_TOKEN_TYPE( pToken->pNext->type ) == HB_PP_TOKEN_KEYWORD )
|
||||
{
|
||||
if( HB_COMP_PARAM->functions.pLast->wForCounter == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly < 2 )
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E',
|
||||
HB_COMP_ERR_NEXTFOR, NULL, NULL );
|
||||
pLex->iState = iType;
|
||||
|
||||
@@ -272,10 +272,11 @@ void hb_compGenCObj( HB_COMP_DECL, PHB_FNAME pFileName )
|
||||
if( HB_COMP_PARAM->pOutPath->szPath )
|
||||
pOut->szPath = HB_COMP_PARAM->pOutPath->szPath;
|
||||
|
||||
#if defined( __BORLANDC__ ) || defined( _MSC_VER ) || defined( __WATCOMC__ )
|
||||
#if ( defined( HB_OS_DOS ) || defined( HB_OS_WIN ) || defined( HB_OS_OS2 ) ) && \
|
||||
!defined( __GNUC__ )
|
||||
pOut->szExtension = ".obj";
|
||||
#else
|
||||
pOut->szExtension = ".o"; /* Don't know if we can hardcode it for Un*x */
|
||||
pOut->szExtension = ".o";
|
||||
#endif
|
||||
hb_fsFNameMerge( pszTemp, pOut );
|
||||
|
||||
|
||||
@@ -229,10 +229,10 @@ HB_COMP_PTR hb_comp_new( void )
|
||||
pComp->fCredits = FALSE; /* print credits */
|
||||
pComp->fBuildInfo = FALSE; /* print build info */
|
||||
pComp->fLogo = TRUE; /* print logo */
|
||||
pComp->fSyntaxCheckOnly = FALSE; /* syntax check only */
|
||||
pComp->fSingleModule = FALSE;
|
||||
pComp->fError = FALSE;
|
||||
|
||||
pComp->iSyntaxCheckOnly = 0; /* syntax check only */
|
||||
pComp->iStartProc = 0; /* no implicit starting procedure */
|
||||
pComp->iWarnings = 0; /* enable parse warnings */
|
||||
pComp->iErrorCount = 0; /* number of compile errors */
|
||||
@@ -293,6 +293,9 @@ void hb_comp_free( HB_COMP_PTR pComp )
|
||||
hb_xfree( pComp->pLex );
|
||||
}
|
||||
|
||||
if( pComp->szDepExt )
|
||||
hb_xfree( pComp->szDepExt );
|
||||
|
||||
if( pComp->szStdCh )
|
||||
hb_xfree( pComp->szStdCh );
|
||||
|
||||
|
||||
@@ -81,9 +81,14 @@ int hb_compMain( int argc, const char * const argv[],
|
||||
hb_compChkCompilerSwitch( HB_COMP_PARAM, argc, argv );
|
||||
if( !HB_COMP_PARAM->fExit )
|
||||
{
|
||||
if( HB_COMP_PARAM->iTraceInclude == 0 &&
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly == 2 )
|
||||
HB_COMP_PARAM->iTraceInclude = 1;
|
||||
|
||||
if( pBufPtr && pulSize )
|
||||
{
|
||||
if( HB_COMP_PARAM->iTraceInclude > 0 )
|
||||
if( HB_COMP_PARAM->iTraceInclude > 0 &&
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly > 0 )
|
||||
HB_COMP_PARAM->iTraceInclude |= 0x100;
|
||||
else
|
||||
HB_COMP_PARAM->iLanguage = HB_LANG_PORT_OBJ_BUF;
|
||||
@@ -3909,8 +3914,47 @@ static void hb_compGenIncluded( HB_COMP_DECL )
|
||||
if( HB_COMP_PARAM->iTraceInclude > 0 && HB_COMP_PARAM->incfiles )
|
||||
{
|
||||
PHB_INCLST pIncFile = HB_COMP_PARAM->incfiles;
|
||||
char szDestFile[ HB_PATH_MAX ];
|
||||
HB_FNAME FileName;
|
||||
|
||||
if( HB_COMP_PARAM->iTraceInclude > 0x100 )
|
||||
memcpy( &FileName, HB_COMP_PARAM->pFileName, sizeof( HB_FNAME ) );
|
||||
szDestFile[ 0 ] = '\0';
|
||||
|
||||
if( ( HB_COMP_PARAM->iTraceInclude & 0xff ) == 2 )
|
||||
{
|
||||
FileName.szExtension = HB_COMP_PARAM->szDepExt;
|
||||
if( !FileName.szExtension ) switch( HB_COMP_PARAM->iLanguage )
|
||||
{
|
||||
case HB_LANG_C:
|
||||
FileName.szExtension = ".c";
|
||||
break;
|
||||
#ifdef HB_GEN_OBJ32
|
||||
case HB_LANG_OBJ32:
|
||||
FileName.szExtension = ".obj";
|
||||
break;
|
||||
#endif
|
||||
case HB_LANG_PORT_OBJ:
|
||||
case HB_LANG_PORT_OBJ_BUF:
|
||||
FileName.szExtension = ".hrb";
|
||||
break;
|
||||
|
||||
#ifdef HB_LEGACY_LEVEL2
|
||||
case HB_LANG_OBJ_MODULE:
|
||||
# if ( defined( HB_OS_DOS ) || defined( HB_OS_WIN ) || defined( HB_OS_OS2 ) ) && \
|
||||
!defined( __GNUC__ )
|
||||
FileName.szExtension = ".obj";
|
||||
# else
|
||||
FileName.szExtension = ".o";
|
||||
# endif
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
FileName.szExtension = ".c";
|
||||
}
|
||||
hb_fsFNameMerge( szDestFile, &FileName );
|
||||
}
|
||||
|
||||
if( ( HB_COMP_PARAM->iTraceInclude & 0x100 ) != 0 )
|
||||
{
|
||||
ULONG ulLen = 0, u;
|
||||
BYTE * buffer;
|
||||
@@ -3920,14 +3964,24 @@ static void hb_compGenIncluded( HB_COMP_DECL )
|
||||
ulLen += ( ULONG ) strlen( pIncFile->szFileName ) + 1;
|
||||
pIncFile = pIncFile->pNext;
|
||||
}
|
||||
u = HB_COMP_PARAM->ulOutBufSize;
|
||||
if( u != 0 )
|
||||
if( HB_COMP_PARAM->ulOutBufSize != 0 )
|
||||
++ulLen;
|
||||
u = ( ULONG ) strlen( szDestFile );
|
||||
if( u )
|
||||
ulLen += u + 2;
|
||||
HB_COMP_PARAM->pOutBuf = ( BYTE * ) hb_xrealloc(
|
||||
HB_COMP_PARAM->pOutBuf, u + ulLen );
|
||||
buffer = HB_COMP_PARAM->pOutBuf + u;
|
||||
if( u != 0 )
|
||||
*buffer++ = pIncFile ? ' ' : '\t';
|
||||
HB_COMP_PARAM->pOutBuf,
|
||||
HB_COMP_PARAM->ulOutBufSize + ulLen );
|
||||
buffer = HB_COMP_PARAM->pOutBuf + HB_COMP_PARAM->ulOutBufSize;
|
||||
if( HB_COMP_PARAM->ulOutBufSize != 0 )
|
||||
*buffer++ = '\n';
|
||||
if( u )
|
||||
{
|
||||
memcpy( buffer, szDestFile, u );
|
||||
buffer += u;
|
||||
*buffer++ = ':';
|
||||
*buffer++ = ' ';
|
||||
}
|
||||
HB_COMP_PARAM->ulOutBufSize += ulLen - 1;
|
||||
pIncFile = HB_COMP_PARAM->incfiles;
|
||||
while( pIncFile )
|
||||
@@ -3939,10 +3993,38 @@ static void hb_compGenIncluded( HB_COMP_DECL )
|
||||
*buffer++ = pIncFile ? ' ' : '\0';
|
||||
}
|
||||
}
|
||||
else if( ( HB_COMP_PARAM->iTraceInclude & 0xff ) == 2 )
|
||||
{
|
||||
char szFileName[ HB_PATH_MAX ];
|
||||
FILE * file;
|
||||
|
||||
FileName.szExtension = ".d";
|
||||
hb_fsFNameMerge( szFileName, &FileName );
|
||||
file = hb_fopen( szFileName, "w" );
|
||||
if( file )
|
||||
{
|
||||
if( szDestFile[ 0 ] )
|
||||
fprintf( file, "%s:", szDestFile );
|
||||
while( pIncFile )
|
||||
{
|
||||
fprintf( file, " %s", pIncFile->szFileName );
|
||||
pIncFile = pIncFile->pNext;
|
||||
}
|
||||
fprintf( file, "\n" );
|
||||
fclose( file );
|
||||
}
|
||||
else
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'E', HB_COMP_ERR_CREATE_OUTPUT, szFileName, NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL fFullQuiet = HB_COMP_PARAM->fFullQuiet;
|
||||
HB_COMP_PARAM->fFullQuiet = FALSE;
|
||||
if( szDestFile[ 0 ] )
|
||||
{
|
||||
hb_compOutStd( HB_COMP_PARAM, szDestFile );
|
||||
hb_compOutStd( HB_COMP_PARAM, ": " );
|
||||
}
|
||||
while( pIncFile )
|
||||
{
|
||||
if( pIncFile != HB_COMP_PARAM->incfiles )
|
||||
@@ -4102,7 +4184,7 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, const char * szBuff
|
||||
if( !HB_COMP_PARAM->fExit )
|
||||
{
|
||||
int iExitLevel = HB_COMP_PARAM->iExitLevel;
|
||||
if( HB_COMP_PARAM->iTraceInclude > 0 )
|
||||
if( HB_COMP_PARAM->iSyntaxCheckOnly >= 2 )
|
||||
hb_compParserRun( HB_COMP_PARAM );
|
||||
else
|
||||
hb_compparse( HB_COMP_PARAM );
|
||||
@@ -4218,21 +4300,20 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, const char * szBuff
|
||||
}
|
||||
}
|
||||
|
||||
if( HB_COMP_PARAM->iTraceInclude > 0 )
|
||||
{
|
||||
if( fGenCode && HB_COMP_PARAM->iErrorCount == 0 )
|
||||
hb_compGenIncluded( HB_COMP_PARAM );
|
||||
fGenCode = FALSE;
|
||||
}
|
||||
else if( ! HB_COMP_PARAM->fSyntaxCheckOnly && fGenCode &&
|
||||
HB_COMP_PARAM->iErrorCount == 0 )
|
||||
/* we create the output file name */
|
||||
hb_compOutputFile( HB_COMP_PARAM );
|
||||
|
||||
if( fGenCode && HB_COMP_PARAM->iErrorCount == 0 &&
|
||||
HB_COMP_PARAM->iTraceInclude > 0 )
|
||||
hb_compGenIncluded( HB_COMP_PARAM );
|
||||
|
||||
if( HB_COMP_PARAM->iSyntaxCheckOnly == 0 &&
|
||||
fGenCode && HB_COMP_PARAM->iErrorCount == 0 )
|
||||
{
|
||||
const char * szFirstFunction = NULL;
|
||||
int iFunctionCount = 0;
|
||||
PFUNCTION pFunc;
|
||||
|
||||
/* we create the output file name */
|
||||
hb_compOutputFile( HB_COMP_PARAM );
|
||||
|
||||
pFunc = HB_COMP_PARAM->functions.pFirst;
|
||||
|
||||
@@ -4287,8 +4368,8 @@ static int hb_compCompile( HB_COMP_DECL, const char * szPrg, const char * szBuff
|
||||
else
|
||||
fGenCode = FALSE;
|
||||
|
||||
if( !fGenCode&& !HB_COMP_PARAM->fExit &&
|
||||
!HB_COMP_PARAM->fSyntaxCheckOnly && HB_COMP_PARAM->iTraceInclude == 0 )
|
||||
if( !fGenCode && !HB_COMP_PARAM->fExit &&
|
||||
HB_COMP_PARAM->iSyntaxCheckOnly == 0 )
|
||||
hb_compOutStd( HB_COMP_PARAM, "\nNo code generated.\n" );
|
||||
|
||||
hb_compCompileEnd( HB_COMP_PARAM );
|
||||
|
||||
@@ -81,6 +81,7 @@ void hb_compPrintUsage( HB_COMP_DECL, const char * szSelf )
|
||||
"\n %cgw output type: Windows/DOS OBJ32 (.obj)",
|
||||
#endif
|
||||
"\n %cgh output type: Harbour Portable Object (.hrb)",
|
||||
"\n %cgd[.<destext>] generate dependencies list into (.d) file",
|
||||
"\n %ci<path> #include file search path",
|
||||
"\n %cj[<file>] generate i18n gettext file (.pot)",
|
||||
"\n %ck compilation mode (type -k? for more data)",
|
||||
@@ -95,9 +96,10 @@ void hb_compPrintUsage( HB_COMP_DECL, const char * szSelf )
|
||||
"\n %cp+ generate pre-processor trace (.ppt) file",
|
||||
"\n %cq quiet",
|
||||
"\n %cq0 quiet and don't display program header",
|
||||
"\n %cq2 disable all output messages",
|
||||
"\n %cr:<max> set maximum number of preprocessor iterations",
|
||||
/* TODO: "\n %cr[<lib>] request linker to search <lib> (or none)", */
|
||||
"\n %cs[m] syntax check only [and generate dependencies list]",
|
||||
"\n %cs[m] syntax check only [minimal for dependencies list]",
|
||||
/* TODO: "\n %ct<path> path for temp file creation", */
|
||||
"\n %cu[<file>] use command def set in <file> (or none)",
|
||||
"\n %cu+<file> add command def set from <file>",
|
||||
|
||||
@@ -81,18 +81,7 @@
|
||||
#include "hbmath.h"
|
||||
#include "rddsys.ch"
|
||||
#include "hbregex.h"
|
||||
|
||||
#ifndef HB_CDP_SUPPORT_OFF
|
||||
/* for nation sorting support */
|
||||
#include "hbapicdp.h"
|
||||
#define hb_cdpcharcmp( c1, c2, cdpage ) \
|
||||
( ( cdpage && cdpage->lSort ) ? \
|
||||
hb_cdpchrcmp( c1, c2, cdpage ) : \
|
||||
( (BYTE)(c1) - (BYTE)(c2) ) )
|
||||
/*
|
||||
#define hb_cdpcharcmp( c1, c2, cdpage ) ( (BYTE)(c1) - (BYTE)(c2) )
|
||||
*/
|
||||
#endif
|
||||
#include "hbapicdp.h"
|
||||
|
||||
/*
|
||||
* Tag->fRePos = TURE means that rootPage->...->childLeafPage path is
|
||||
|
||||
@@ -4665,7 +4665,7 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, cParentDir, tTimeParent, lInc
|
||||
hbmk_OutStd( hb_StrFormat( "debuginc: Calling Harbour compiler to detect dependencies of %1$s", cFileName ) )
|
||||
ENDIF
|
||||
|
||||
aCommand := ArrayAJoin( { { "-q0", "-sm", "-kj" },;
|
||||
aCommand := ArrayAJoin( { { "-q0", "-sm" },;
|
||||
{ iif( hbmk[ _HBMK_lCreateLib ] .OR. hbmk[ _HBMK_lCreateDyn ], "-n1", "-n2" ) },;
|
||||
{ cFileName },;
|
||||
iif( hbmk[ _HBMK_lBLDFLGP ], { " " + hb_Version( HB_VERSION_FLAG_PRG ) }, {} ),;
|
||||
@@ -4754,7 +4754,7 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, cParentDir, tTimeParent, lInc
|
||||
cHeader := NIL
|
||||
nPos := 1
|
||||
DO WHILE .T.
|
||||
|
||||
|
||||
IF ( tmp := hb_At( '#include "', cFile, nPos ) ) > 0
|
||||
nPos := tmp + Len( '#include "' )
|
||||
IF ( tmp := hb_At( '"', cFile, nPos ) ) > 0
|
||||
@@ -4763,7 +4763,7 @@ STATIC FUNCTION FindNewerHeaders( hbmk, cFileName, cParentDir, tTimeParent, lInc
|
||||
ELSE
|
||||
EXIT
|
||||
ENDIF
|
||||
|
||||
|
||||
IF cHeader != NIL .AND. ;
|
||||
FindNewerHeaders( hbmk, cHeader, iif( lCMode, FN_DirGet( cFileName ), cParentDir ), tTimeParent, lIncTry, lCMode, nEsc, @headstate, nNestingLevel + 1 )
|
||||
headstate[ _HEADSTATE_lAnyNewer ] := .T.
|
||||
@@ -4790,7 +4790,7 @@ STATIC FUNCTION deplst_read( hDeps, cFileName )
|
||||
FOR EACH cLine IN hb_ATokens( cFileBody, Chr( 10 ) )
|
||||
++nLine
|
||||
cLine := AllTrim( cLine )
|
||||
IF cLine == "\" .OR. right( cLine, 2 ) == " \"
|
||||
IF cLine == "\" .OR. Right( cLine, 2 ) == " \"
|
||||
cList += Left( cLine, Len( cLine ) - 1 )
|
||||
ELSE
|
||||
cList += cLine
|
||||
@@ -4831,7 +4831,7 @@ STATIC FUNCTION deplst_add( hDeps, cList )
|
||||
RETURN .T.
|
||||
|
||||
STATIC FUNCTION AMerge( aDst, aSrc )
|
||||
LOCAL ITEM
|
||||
LOCAL item
|
||||
|
||||
FOR EACH item IN aSrc
|
||||
IF hb_AScan( aDst, item,,, .T. ) == 0
|
||||
|
||||
Reference in New Issue
Block a user