#include <WOKStep_Compile.ixx>
+#include <OSD_Protection.hxx>
+#include <OSD_File.hxx>
+
//=======================================================================
//function : WOKStep_Compile
//purpose :
ashell->Lock();
myiterator.Init(ashell, OutputDir(), incdirs, dbdirs);
+#ifndef WNT
+ static Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( "\n" );
+#else
+ static Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( "\r\n" );
+#endif // WNT
+ Handle( TCollection_HAsciiString ) str = new TCollection_HAsciiString ();
for(j=1; j<=execlist->Length(); j++)
{
}
}
+ if ( !myiterator.CmdLine ().IsNull () ) {
+
+ Standard_Integer i, j;
+ Handle( TCollection_HAsciiString ) s = new TCollection_HAsciiString (
+ myiterator.CmdLine ()
+ );
+
+ char const* ptr = s -> ToCString ();
+
+ for ( i = 0, j = -1; i < s -> Length (); ++i, ++ptr )
+
+ if ( ( *ptr == '\r' && i && *( ptr - 1 ) != '\\' ) ||
+ ( *ptr == '\n' && i && *( ptr - 1 ) != '\\' ) ||
+ *ptr == '>' ||
+ *ptr == ';'
+ ) {
+
+ j = i;
+ break;
+
+ } // end if
+
+ if ( j != -1 ) {
+
+ s = s -> SubString ( 1, j );
+
+ if ( !s.IsNull () && !s -> IsEmpty () ) {
+
+ str -> AssignCat ( s );
+ str -> AssignCat ( NL );
+
+ } // end if
+
+ } // end if
+
+ } // end if
+
TreatOutput(infile,myiterator.Produces());
succeeds->Append(infile);
<< "-----------------------------------------------------------------" << endm;
}
+ if ( !str -> IsEmpty () ) {
+
+ Handle( TCollection_HAsciiString ) s = new TCollection_HAsciiString ( Unit () -> Name () );
+ s -> AssignCat ( ".comp" );
+ Handle( WOKernel_File ) stadm = new WOKernel_File (
+ s, Unit (), Unit () ->
+ GetFileType ( "stadmfile" )
+ );
+
+ stadm -> GetPath ();
+
+ OSD_Path p ( stadm -> Path () -> Name () -> ToCString () );
+ OSD_File f ( p );
+
+ f.Build (
+ OSD_WriteOnly, OSD_Protection ( OSD_RWXD, OSD_RWXD, OSD_R, OSD_R )
+ );
+
+ if ( !f.Failed () ) {
+
+ f.Write ( str -> String (), str -> Length () );
+
+ if ( f.Failed () ) {
+
+ TCollection_AsciiString s;
+
+ p.SystemName ( s );
+
+ ErrorMsg << "WOKStep_Compile :: Execute"
+ << "could not create '" << new TCollection_HAsciiString ( s )
+ << "'" << endm;
+
+ } // end if
+
+ f.Close ();
+
+ } // end if
+
+ } // end if
+
if(fails->Length() && succeeds->Length())
{
SetIncomplete();
#define CHECK_REMOTE 1
#endif // WNT
+#ifdef LIN
+# include <iomanip.h>
+#endif // LIN
+
//=======================================================================
//function : WOKStep_ProcessStep
//purpose :
Handle(WOKMake_OutputFile) outfile;
// je calcule le path de destination du file
aoutfile->GetPath();
-
+//-> EUG4YAN
+ TCollection_AsciiString s;
+ OSD_Path p ( outent -> Path () -> Name () -> ToCString () );
+//<- EUG4YAN
// je l'y deplace
outent->Path()->MoveTo(aoutfile->Path());
+//-> EUG4YAN
+ if ( extens == WOKUtils_ObjectFile ) {
+
+ p.SetExtension ( ".d" );
+ p.SystemName ( s );
+
+ Handle( WOKUtils_Path ) pp = new WOKUtils_Path (
+ new TCollection_HAsciiString ( s )
+ );
+
+ if ( pp -> Exists () ) {
+
+ OSD_Path p ( aoutfile -> Path () -> Name () -> ToCString () );
+
+ p.SetExtension ( ".d" );
+ p.SystemName ( s );
+
+ Handle( WOKUtils_Path ) pd = new WOKUtils_Path (
+ new TCollection_HAsciiString ( s )
+ );
+
+ pp -> MoveTo ( pd );
+
+ } // end if
+ } // end if
+//<- EUG4YAN
if(!istemplate)
{
outfile = new WOKMake_OutputFile(aoutfile->LocatorName(), aoutfile, outent, aoutfile->Path());