static unsigned ProcPMake( char *cmd, bool ignore_errors ) { pmake_data *data; unsigned res; char save[_MAX_PATH]; data = PMakeBuild( cmd ); if( data == NULL ) return( 1 ); if( data->want_help || data->signaled ) { PMakeCleanup( data ); return( 2 ); } strcpy( save, IncludeStk->cwd ); res = DoPMake( data, ignore_errors ); SysChdir( save ); getcwd( IncludeStk->cwd, sizeof( IncludeStk->cwd ) ); PMakeCleanup( data ); return( res ); }
int main( int argc, char **argv ) { #else int main( void ) { #endif pmake_data *data; int rc; #if !defined( __WATCOMC__ ) _argv = argv; _argc = argc; #endif getcmd( CmdBuff ); data = PMakeBuild( CmdBuff ); if( data == NULL ) { exit( EXIT_FAILURE ); } if( data->want_help ) { PrintHelp(); } if( data->want_help || data->signaled ) { PMakeCleanup( data ); exit( EXIT_FAILURE ); } /* If -b was given, only write out a batch file. By default, * execute the commands directly. */ if( data->batch ) { WriteCmdFile( data ); rc = 0; } else { rc = ProcPMake( data ); } PMakeCleanup( data ); return( rc ); }
int main( int argc, char **argv ) { _argv = argv; _argc = argc; #else int main( void ) { #endif pmake_data *data; getcmd( CmdBuff ); data = PMakeBuild( CmdBuff ); if( data == NULL ) { exit( EXIT_FAILURE ); } if( data->want_help ) { PrintHelp(); } WriteCmdFile( data ); PMakeCleanup( data ); if( !data->batch ) { if( intSystem( TMPBAT ) ) { printf( "PMAKE: error during attempt to run %s: %s\n", TMPBAT, strerror( errno ) ); return( EXIT_FAILURE ); } #ifndef __UNIX__ if( remove( TMPBAT ) ) { printf( "PMAKE: unable to remove %s: %s\n", TMPBAT, strerror( errno ) ); return( EXIT_FAILURE ); } #endif } return( EXIT_SUCCESS ); }