20000313-15:57 GMT+1 Victor Szakats <info@szelvesz.hu>

This commit is contained in:
Viktor Szakats
2000-03-13 15:03:53 +00:00
parent 8b2a589dc2
commit 6b72938dee
13 changed files with 487 additions and 841 deletions

View File

@@ -1,3 +1,16 @@
20000313-15:57 GMT+1 Victor Szakats <info@szelvesz.hu>
* source/compiler/cmdcheck.c
source/compiler/harbour.c
source/compiler/hbusage.c
source/compiler/gen*.c
include/hbcomp.h
+ Added processing of multiple .PRG files passed to the Harbour compiler.
* contrib/rdd_ads/makefile.vc
+ Minor changes.
* makefile.vc
% Optimized MSVC make process, much smaller and faster.
Thanks go to Paul Tucker.
20000313-13:20 GMT+1 Victor Szakats <info@szelvesz.hu>
* contrib/rdd_ads/adsfunc.c
! Two casts added for MSVC.

View File

@@ -6,28 +6,27 @@
# Directory macros. These should never have to change.
#
INCLUDE_DIR=..\..\include
OBJ_DIR=..\..\obj\vc
LIB_DIR=..\..\lib\vc
BIN_DIR=..\..\bin\vc
INCLUDE_DIR = ..\..\include
OBJ_DIR = ..\..\obj\vc
LIB_DIR = ..\..\lib\vc
BIN_DIR = ..\..\bin\vc
#
# C compiler definition and C flags. These should never have to change.
#
CC=cl
CFLAGS=-W1 -nologo -I$(INCLUDE_DIR) -D_Windows
CLIBFLAGS=$(CFLAGS) -c /TP
CLIBFLAGSDEBUG=$(CFLAGS) -c -Zi /TP
CC = cl
CFLAGS = -W1 -nologo -I$(INCLUDE_DIR) -D_Windows
CLIBFLAGS = $(CFLAGS) -c /TP
CLIBFLAGSDEBUG = $(CFLAGS) -c -Zi /TP
#
# Macros to access our library names
#
ADS_LIB=$(LIB_DIR)\rddads.lib
HARBOUR_EXE=$(BIN_DIR)\harbour.exe
HARBOURFLAGS=-iinclude -n -q0 -w -es2 -gc0
ADS_LIB = $(LIB_DIR)\rddads.lib
HARBOUR_EXE = $(BIN_DIR)\harbour.exe
HARBOURFLAGS = -i$(INCLUDE_DIR) -n -q0 -w -es2 -gc0
#
# OBJ list for ads.lib

View File

@@ -286,7 +286,6 @@ HB_EXPR_PTR hb_compWarnMeaningless( HB_EXPR_PTR );
extern void hb_compChkCompilerSwitch( int, char * Args[] );
extern void hb_compChkEnvironVar( char * );
extern void hb_compChkCompileFileName( int, char * Args[] );
extern void hb_compCheckPaths( void );
extern void hb_compPrintUsage( char * );

File diff suppressed because it is too large Load Diff

View File

@@ -469,45 +469,6 @@ void hb_compChkEnvironVar( char * szSwitch )
}
}
void hb_compChkCompileFileName( int iArg, char * Args[] )
{
/* If we already have a filename shows a runtime error */
/* NOTE:
This will be removed if we add support for
multiple file name in command line and @file.clp syntax
*/
if( hb_comp_pFileName )
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_BADPARAM, Args[ iArg ], NULL );
if( iArg )
{
int i;
int n = 0;
for( i = 1; i < iArg; i++ )
{
if( !HB_ISOPTSEP( * Args[ i ] ) )
{
n++;
/* NOTE: By now it checks only the first file name
passed and shows a warning for others
*/
if( n > 1 )
/* GenWarning() */
printf( "Warning: File %s will be ignored\n", hb_strupr( Args[ i ] ) );
else
{
hb_comp_pFileName = hb_fsFNameSplit( Args[ i ] );
if( ! hb_comp_pFileName->szName )
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_BADFILENAME, Args[ iArg ], NULL );
}
}
}
}
}
void hb_compCheckPaths( void )
{
char * szInclude = getenv( "INCLUDE" );

View File

@@ -61,7 +61,7 @@ void hb_compGenCCode( PHB_FNAME pFileName ) /* generates the C language ou
if( ! hb_comp_bQuiet )
{
printf( "\nGenerating C source output to \'%s\'... ", szFileName );
printf( "Generating C source output to \'%s\'... ", szFileName );
fflush( stdout );
}

View File

@@ -65,7 +65,7 @@ void hb_compGenPortObj( PHB_FNAME pFileName )
if( ! hb_comp_bQuiet )
{
printf( "\nGenerating Harbour Portable Object output to \'%s\'... ", szFileName );
printf( "Generating Harbour Portable Object output to \'%s\'... ", szFileName );
fflush( stdout );
}

View File

@@ -75,7 +75,7 @@ void hb_compGenJava( PHB_FNAME pFileName )
if( ! hb_comp_bQuiet )
{
printf( "\nGenerating Java source output to \'%s\'... ", szFileName );
printf( "Generating Java source output to \'%s\'... ", szFileName );
fflush( stdout );
}

View File

@@ -100,7 +100,7 @@ void hb_compGenObj32( PHB_FNAME pFileName )
if( ! hb_comp_bQuiet )
{
printf( "\nGenerating Windows/DOS OBJ32 output to \'%s\'... ", szFileName );
printf( "Generating Windows/DOS OBJ32 output to \'%s\'... ", szFileName );
fflush( stdout );
}

View File

@@ -46,7 +46,7 @@ void hb_compGenPascal( PHB_FNAME pFileName )
pFileName->szExtension = ".pas";
hb_fsFNameMerge( szFileName, pFileName );
printf( "\nGenerating Pascal source output to \'%s\'... ", szFileName );
printf( "Generating Pascal source output to \'%s\'... ", szFileName );
fflush( stdout );
printf( "\nNot implemented yet!\n" );

View File

@@ -46,7 +46,7 @@ void hb_compGenRC( PHB_FNAME pFileName )
pFileName->szExtension = ".rc";
hb_fsFNameMerge( szFileName, pFileName );
printf( "\nGenerating Windows resource output to \'%s\'... ", szFileName );
printf( "Generating Windows resource output to \'%s\'... ", szFileName );
fflush( stdout );
printf( "\nNot implemented yet!\n" );

View File

@@ -133,18 +133,12 @@ static PEXTERN hb_comp_pExterns = NULL;
int main( int argc, char * argv[] )
{
int iStatus = 0;
BOOL bSkipGen;
int iStatus = EXIT_SUCCESS;
int i;
BOOL bAnyFiles;
char szFileName[ _POSIX_PATH_MAX ]; /* filename to parse */
char szPpoName[ _POSIX_PATH_MAX ];
hb_comp_pFileName = NULL;
hb_comp_pOutPath = NULL;
/* Initializes hb_comp_pFileName with file name to compile */
hb_compChkCompileFileName( argc, argv );
/* First check the environment variables */
hb_compChkCompilerSwitch( 0, NULL );
@@ -161,86 +155,123 @@ int main( int argc, char * argv[] )
return iStatus;
}
if( hb_comp_pFileName )
/* Process all files passed via the command line. */
bAnyFiles = FALSE;
for( i = 1; i < argc; i++ )
{
if( !hb_comp_pFileName->szExtension )
hb_comp_pFileName->szExtension = ".prg";
hb_fsFNameMerge( szFileName, hb_comp_pFileName );
if( hb_comp_bPPO )
if( !HB_ISOPTSEP( argv[ i ][ 0 ] ) )
{
hb_comp_pFileName->szExtension = ".ppo";
hb_fsFNameMerge( szPpoName, hb_comp_pFileName );
hb_comp_yyppo = fopen( szPpoName, "w" );
if( ! hb_comp_yyppo )
if( !bAnyFiles )
{
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_CREATE_PPO, szPpoName, NULL );
return iStatus;
hb_compCheckPaths();
bAnyFiles = TRUE;
}
hb_comp_pFileName = hb_fsFNameSplit( argv[ i ] );
if( hb_comp_pFileName->szName )
{
char szFileName[ _POSIX_PATH_MAX ]; /* filename to parse */
char szPpoName[ _POSIX_PATH_MAX ];
if( !hb_comp_pFileName->szExtension )
hb_comp_pFileName->szExtension = ".prg";
hb_fsFNameMerge( szFileName, hb_comp_pFileName );
if( hb_comp_bPPO )
{
hb_comp_pFileName->szExtension = ".ppo";
hb_fsFNameMerge( szPpoName, hb_comp_pFileName );
hb_comp_yyppo = fopen( szPpoName, "w" );
if( ! hb_comp_yyppo )
{
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_CREATE_PPO, szPpoName, NULL );
iStatus = EXIT_FAILURE;
}
}
if( iStatus == EXIT_SUCCESS )
{
/* Initialization of preprocessor arrays */
hb_pp_Init();
/* Initialize support variables */
hb_compInitVars();
atexit( close_on_exit );
if( hb_compInclude( szFileName, NULL ) )
{
BOOL bSkipGen;
if( hb_comp_bPPO )
printf( "Compiling '%s' and generating preprocessed output to '%s'...\n", szFileName, szPpoName );
else
printf( "Compiling '%s'...\n", szFileName );
/* Start processing */
hb_compYACCMain( hb_comp_pFileName->szName );
bSkipGen = FALSE;
if( hb_comp_bAnyWarning )
{
if( hb_comp_iExitLevel == HB_EXITLEVEL_SETEXIT )
{
iStatus = EXIT_FAILURE;
}
else if( hb_comp_iExitLevel == HB_EXITLEVEL_DELTARGET )
{
iStatus = EXIT_FAILURE;
bSkipGen = TRUE;
printf( "\nNo code generated.\n" );
}
}
if( ! hb_comp_bSyntaxCheckOnly && ! bSkipGen && ( hb_comp_iErrorCount == 0 ) )
{
/* we create the output file name */
hb_compOutputFile();
if( ! hb_comp_bQuiet )
{
if( ! hb_comp_bStartProc )
--hb_comp_iFunctionCnt;
printf( "\rLines %i, Functions/Procedures %i\n", hb_comp_iLine, hb_comp_iFunctionCnt );
}
hb_compGenOutput( hb_comp_iLanguage );
}
}
else
{
printf( "Cannot open input file: %s\n", szFileName );
/* printf( "No code generated\n" ); */
iStatus = EXIT_FAILURE;
}
if( hb_comp_bPPO && hb_comp_yyppo )
fclose( hb_comp_yyppo );
}
}
else
{
hb_compGenError( hb_comp_szErrors, 'F', HB_COMP_ERR_BADFILENAME, argv[ argc ], NULL );
iStatus = EXIT_FAILURE;
}
hb_xfree( ( void * ) hb_comp_pFileName );
if( iStatus != EXIT_SUCCESS )
break;
}
}
else
{
if( !bAnyFiles )
hb_compPrintUsage( argv[ 0 ] );
return iStatus;
}
/* Initialization of preprocessor arrays */
hb_pp_Init();
/* Initialize support variables */
hb_compInitVars();
atexit( close_on_exit );
if( hb_compInclude( szFileName, NULL ) )
{
hb_compCheckPaths();
/*
* Start processing
*/
hb_compYACCMain( hb_comp_pFileName->szName );
bSkipGen = FALSE;
if( hb_comp_bAnyWarning )
{
if( hb_comp_iExitLevel == HB_EXITLEVEL_SETEXIT )
iStatus = 1;
if( hb_comp_iExitLevel == HB_EXITLEVEL_DELTARGET )
{
iStatus = 1;
bSkipGen = TRUE;
printf( "\nNo code generated\n" );
}
}
if( ! hb_comp_bSyntaxCheckOnly && ! bSkipGen && ( hb_comp_iErrorCount == 0 ) )
{
/* we create the output file name */
hb_compOutputFile();
if( ! hb_comp_bQuiet )
{
if( ! hb_comp_bStartProc )
--hb_comp_iFunctionCnt;
printf( "\rLines %i, Functions/Procedures %i\n", hb_comp_iLine, hb_comp_iFunctionCnt );
}
hb_compGenOutput( hb_comp_iLanguage );
}
if( hb_comp_bPPO )
fclose( hb_comp_yyppo );
}
else
{
printf( "Cannot open input file: %s\n", szFileName );
/* printf( "No code generated\n" ); */
iStatus = 1;
}
hb_xfree( ( void * ) hb_comp_pFileName );
if( hb_comp_pOutPath )
hb_xfree( hb_comp_pOutPath );

View File

@@ -81,7 +81,7 @@ void hb_compPrintUsage( char * szSelf )
int iLine;
printf( "\nSyntax: %s <file[.prg]> [options]"
printf( "\nSyntax: %s <file[s][.prg]> [options]"
"\n", szSelf );
for( iLine = 0; iLine < ( sizeof( szOptions ) / sizeof( char * ) ); iLine++ )