--- /dev/null
+WOKStep_ccl.tcl
+WOKStep_frontal.tcl
+WOKStep_TclLibIdep.tcl
--- /dev/null
+-- File: WOKStep.cdl
+-- Created: Thu Jun 27 17:12:45 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+package WOKStep
+
+ ---Purpose:
+
+uses
+ WOKMake,
+ WOKBuilder,
+ WOKernel,
+ WOKUtils,
+ WOKTools,
+ TColStd,
+ TCollection
+
+is
+
+ class Source;
+
+ class CDLUnitSource;
+ class ExecutableSource;
+ class ResourceSource;
+ class ToolkitSource;
+
+ deferred class MSStep;
+
+ class MSFill;
+
+ deferred class Extract;
+
+ class TemplateExtract;
+ class SourceExtract;
+ class HeaderExtract;
+ class ServerExtract;
+ class ClientExtract;
+ class EngineExtract;
+
+ class ExtractExecList;
+
+ class Include;
+
+ deferred class ProcessStep;
+ --C++: Base class for steps concerning
+ -- processors such as compilers, code generators, preprocessors ...
+
+ class CodeGenerate;
+ class Compile;
+
+
+
+ class LibUnCompress;
+ class LibExtract;
+ class LibLimit;
+
+
+ deferred class Library;
+ class DynamicLibrary;
+ class ArchiveLibrary;
+
+ class ImplementationDep;
+
+ deferred class LinkList;
+
+ class TKList;
+ class WNTK;
+
+ deferred class ComputeLinkList;
+
+ class TransitiveLinkList;
+ class DirectLinkList;
+
+ class EngLinkList;
+
+
+ deferred class TKReplace;
+
+ class TransitiveTKReplace;
+ class DirectTKReplace;
+
+ deferred class Link;
+
+ class ExecLink;
+ class LibLink;
+
+ class EngDatFiles;
+ class EngLDFile;
+
+
+ ------------------------------------------
+ -- Windows NT ----------------------------
+ ------------------------------------------
+ ------
+ ------
+ deferred class WNTCollect; ------
+ ------
+ deferred class WNTLink; ------
+ class DLLink; ------
+ class EXELink; ------
+ ------
+ deferred class WNTLibrary; ------
+ class ImportLibrary; ------
+ class StaticLibrary; ------
+ ------
+ ------------------------------------------
+ ------------------------------------------
+ ------------------------------------------
+
+end WOKStep;
--- /dev/null
+-- File: WOKStep_ArchiveLibrary.cdl
+-- Created: Thu Jun 27 17:29:55 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class ArchiveLibrary from WOKStep
+inherits Library from WOKStep
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+is
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ArchiveLibrary from WOKStep;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end ArchiveLibrary;
+
--- /dev/null
+// File: WOKStep_ArchiveLibrary.cxx
+// Created: Tue Aug 29 21:37:36 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <TCollection_HAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+
+#include <WOKBuilder_Archiver.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_Miscellaneous.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_HSequenceOfObjectFile.hxx>
+
+#include <WOKMake_HSequenceOfInputFile.hxx>
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKStep_ArchiveLibrary.ixx>
+
+
+//=======================================================================
+//function : WOKStep_ArchiveLibrary
+//purpose :
+//=======================================================================
+ WOKStep_ArchiveLibrary::WOKStep_ArchiveLibrary(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Library(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_ArchiveLibrary::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(WOKBuilder_HSequenceOfObjectFile) aseq = new WOKBuilder_HSequenceOfObjectFile;
+ Handle(WOKBuilder_Entity) anent;
+ Handle(WOKBuilder_ObjectFile) anobject;
+ Handle(WOKernel_FileType) archtype = Unit()->FileTypeBase()->Type("archive");
+ Handle(WOKernel_FileType) stadmtype = Unit()->FileTypeBase()->Type("stadmfile");
+ Handle(WOKernel_FileType) tmptype = Unit()->FileTypeBase()->Type("tmpdir");
+ Handle(WOKernel_File) tmppath;
+ Handle(TCollection_HAsciiString) logname;
+ Handle(TCollection_HAsciiString) libname;
+ Handle(TCollection_HAsciiString) bidname;
+
+ Standard_Integer i,j;
+
+ Handle(WOKBuilder_Archiver) ar = new WOKBuilder_Archiver(Unit()->Params());
+ Handle(WOKUtils_Shell) ashell = Shell();
+
+ ar->SetShell(ashell);
+ ashell->Lock();
+
+ ar->SetOutputDir(OutputDir());
+
+ logname = new TCollection_HAsciiString(Unit()->Name());
+
+ if(!SubCode().IsNull())
+ {
+ logname->AssignCat("_");
+ logname->AssignCat(SubCode());
+ }
+
+ logname->AssignCat(".Log");
+
+ Handle(WOKernel_File) logfile = new WOKernel_File(logname, Unit(), Unit()->GetFileType("stadmfile"));
+ logfile->GetPath();
+
+ if(logfile->Path()->Exists()) logfile->Path()->RemoveFile();
+
+ ashell->LogInFile(logfile->Path());
+
+ for(j=1; j<=execlist->Length(); j++)
+ {
+ const Handle(WOKMake_InputFile)& infile = execlist->Value(j);
+ anobject = Handle(WOKBuilder_ObjectFile)::DownCast(infile->BuilderEntity());
+
+ if(anobject.IsNull())
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(infile);
+
+ outfile->SetReference();
+ outfile->SetExtern();
+
+ Handle(WOKernel_DevUnit) unit = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ if(!unit.IsNull())
+ {
+ if(!strcmp(unit->Name()->ToCString(), Unit()->Name()->ToCString()))
+ outfile->SetMember();
+ }
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ else
+ {
+ aseq->Append(anobject);
+ }
+ }
+
+
+ ar->SetObjectList(aseq);
+
+ if(SubCode().IsNull())
+ {
+ ar->SetTargetName(Unit()->Name());
+ }
+ else
+ {
+ ar->SetTargetName(SubCode());
+ }
+
+ // calcul de la librairie
+ InfoMsg << "WOKStep_ArchiveLibrary::Execute" << "Creating : lib" << ar->TargetName() << ".a" << endm;
+
+ switch(ar->Execute())
+ {
+ case WOKBuilder_Success:
+ for(i=1; i<=ar->Produces()->Length(); i++)
+ {
+ Handle(WOKernel_File) file;
+ Handle(WOKBuilder_Entity) outent = ar->Produces()->Value(i);
+ Handle(WOKMake_OutputFile) outfile;
+ Handle(WOKMake_OutputFile) outobjlist;
+
+ if(outent->IsKind(STANDARD_TYPE(WOKBuilder_ArchiveLibrary)))
+ file = new WOKernel_File(outent->Path()->FileName(), Unit(), archtype);
+ else
+ {
+ if(outent->IsKind(STANDARD_TYPE(WOKBuilder_Miscellaneous)))
+ file = new WOKernel_File(outent->Path()->FileName(), Unit(), stadmtype);
+ }
+
+ if(!file.IsNull())
+ {
+ file->GetPath();
+ outent->Path()->MoveTo(file->Path());
+
+ outfile = new WOKMake_OutputFile(file->LocatorName(), file, outent, file->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+
+ for(j=1; j<=execlist->Length(); j++)
+ {
+ AddExecDepItem(execlist->Value(j), outfile, Standard_True);
+ }
+ }
+ }
+ InfoMsg << "WOKStep_ArchiveLibrary::Execute"
+ << "Succeeded : lib" << ar->TargetName() << ".a" << endm;
+ SetSucceeded();
+ break;
+ case WOKBuilder_Failed:
+ ErrorMsg << "WOKStep_ArchiveLibrary"
+ << "Failed : lib" << ar->TargetName() << ".a" << endm;
+ SetFailed();
+ break;
+ }
+ ashell->NoLog();
+ ashell->UnLock();
+ return;
+}
+
+
+
+
+
+
--- /dev/null
+-- File: WOKStep_CDLUnitSource.cdl
+-- Created: Thu Jun 27 17:16:21 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class CDLUnitSource from WOKStep
+inherits Source from WOKStep
+
+ ---Purpose: Computes CDLUnitSource File List.
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ File from WOKernel,
+ HSequenceOfFile from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable CDLUnitSource from WOKStep;
+
+ GetUnitDescr(me)
+ returns File from WOKernel
+ is protected;
+
+ ReadUnitDescr(me:mutable; unitcdl : InputFile from WOKMake) is virtual protected;
+ ---Purpose: Read Unit.cdl file to obtain CDL files list
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ ---Purpose: Executes step
+ -- Computes output files
+ is redefined private;
+
+end CDLUnitSource;
--- /dev/null
+// File: WOKStep_CDLUnitSource.cxx
+// Created: Tue Aug 29 21:40:36 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#ifndef DONT_COMPENSATE
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <time.h>
+
+#include <iostream.h>
+
+#endif
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Param.hxx>
+
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+
+#include <WOKBuilder_CDLFile.hxx>
+#include <WOKBuilder_MSTool.hxx>
+#include <WOKBuilder_MSAction.hxx>
+#include <WOKBuilder_MSchema.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_MSTranslatorIterator.hxx>
+#include <WOKBuilder_MSTranslator.hxx>
+
+#include <WOKMake_DepItem.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_InputFile.hxx>
+
+#include <WOKStep_CDLUnitSource.ixx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+# include <windows.h>
+# define sleep( nSec ) Sleep ( 1000 * ( nSec ) )
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_CDLUnitSource
+//purpose :
+//=======================================================================
+WOKStep_CDLUnitSource::WOKStep_CDLUnitSource(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Source(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : GetUnitDescr
+//purpose :
+//=======================================================================
+Handle(WOKernel_File) WOKStep_CDLUnitSource::GetUnitDescr() const
+{
+ Handle(TCollection_HAsciiString) astr;
+ Handle(TCollection_HAsciiString) asourcetype = new TCollection_HAsciiString("source");
+ Handle(WOKernel_File) afile;
+
+ astr = new TCollection_HAsciiString(Unit()->Name());
+ astr->AssignCat(".cdl");
+ afile = Locator()->Locate(Unit()->Name(), asourcetype, astr);
+ return afile;
+}
+
+//=======================================================================
+//function : ReadUnitDescr
+//purpose :
+//=======================================================================
+void WOKStep_CDLUnitSource::ReadUnitDescr(const Handle(WOKMake_InputFile)& PKCDL)
+{
+ Handle(WOKBuilder_MSTranslator) acdlt = new WOKBuilder_MSTranslator(new TCollection_HAsciiString("CDLTranslate"), Unit()->Params());
+ Handle(WOKBuilder_MSchema) ams = WOKBuilder_MSTool::GetMSchema();
+ Handle(WOKBuilder_Specification) aspec;
+ Handle(WOKernel_File) acdlfile, gefile;
+ Handle(WOKMake_InputFile) geitem;
+ Handle(TCollection_HAsciiString) astr;
+ Handle(TCollection_HAsciiString) aunitname;
+ Handle(TCollection_HAsciiString) sourcetype = new TCollection_HAsciiString("source");
+ Handle(TColStd_HSequenceOfHAsciiString) aseq;
+ Standard_Integer i;
+ Standard_Boolean stop = Standard_False;
+
+
+#ifndef DONT_COMPENSATE
+
+ {
+ Handle(WOKernel_File) srcdir = new WOKernel_File(new TCollection_HAsciiString("testdate.temoin"),
+ Unit(), Unit()->GetFileType("source"));
+
+ srcdir->GetPath();
+
+ Standard_CString tempath = srcdir->Path()->Name()->ToCString();
+ Standard_Integer fd;
+#ifndef WNT
+ if((fd=open(tempath, O_WRONLY | O_CREAT| O_TRUNC)) == -1)
+#else
+ if((fd=open(tempath, O_WRONLY | O_CREAT| O_TRUNC, _S_IREAD | _S_IWRITE)) == -1)
+#endif // WNT
+ {
+ //WarningMsg << "WOKStep_MSFill::Execute"
+ // << "Could not create : " << tempath << endm;
+ //perror(tempath);
+ }
+ else
+ {
+ close(fd);
+ }
+
+ if(fd != -1 )
+ {
+ struct stat buf;
+
+ if(stat(tempath, &buf))
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Could not stat : " << tempath << endm;
+ }
+
+ time_t curdate ;
+
+ curdate = time(NULL);
+ if(curdate == -1)
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Could not obtain current date" << endm;
+ }
+
+ unlink(tempath);
+
+ Standard_Integer decal = buf.st_mtime - curdate;
+
+ if(decal < 0)
+ {
+ WarningMsg << "WOKStep_MSFill::Execute"
+ << "Cannot compensate negative (" << decal << "s) time displace" << endm;
+ }
+ else if(decal > 0)
+ {
+ WarningMsg << "WOKStep_MSFill::Execute"
+ << "Trying compensate positive (" << decal << "s) time displace" << endm;
+ sleep(decal);
+ }
+ }
+ }
+
+#endif
+
+
+ // Initialisation du traducteur
+ acdlt->Load();
+ acdlt->SetMSchema(WOKBuilder_MSTool::GetMSchema());
+
+
+ WOKBuilder_MSTranslatorIterator& anit = BuildProcess()->TranslatorIterator();
+ Handle(WOKBuilder_MSEntity) theentity;
+
+ if(WOKernel_IsExecutable(Unit()))
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_Executable);
+ }
+ else if(WOKernel_IsServer(Unit()))
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_Component);
+ }
+ else
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_GlobEnt);
+ }
+
+ while(anit.More() && !stop)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKBuilder_MSAction) anaction = anit.Value();
+
+ astr = ams->AssociatedFile(anaction->Entity()->Name());
+ aunitname = ams->AssociatedEntity(anaction->Entity()->Name());
+
+ acdlfile = Locator()->Locate(aunitname, new TCollection_HAsciiString("source"), astr);
+
+ if(!acdlfile.IsNull())
+ {
+ aspec = new WOKBuilder_CDLFile(acdlfile->Path());
+
+ switch(anit.Execute(acdlt, anaction, aspec))
+ {
+ case WOKBuilder_Unbuilt:
+ case WOKBuilder_Success:
+ break;
+ case WOKBuilder_Failed:
+ stop = Standard_True;
+ anit.Reset();
+ break;
+ }
+ }
+ else
+ {
+ WarningMsg << "WOKStep_MSFill::Execute" << "No file " << astr << " in " << aunitname << endm;
+ SetIncomplete();
+ }
+
+ anit.Next();
+ }
+
+ const Handle(MS_MetaSchema)& theschema = WOKBuilder_MSTool::GetMSchema()->MetaSchema();
+ if (!stop) {
+ // test du type d'ud
+ if (WOKernel_IsPackage(Unit())) {
+ if (!theschema->IsPackage(Unit()->Name())) {
+ stop = Standard_True;
+ }
+ }
+ else if (WOKernel_IsSchema(Unit())) {
+ if (!theschema->IsSchema(Unit()->Name())) {
+ stop = Standard_True;
+ }
+ }
+ else if (WOKernel_IsInterface(Unit())) {
+ if (!theschema->IsInterface(Unit()->Name())) {
+ stop = Standard_True;
+ }
+ }
+ else if (WOKernel_IsClient(Unit())) {
+ if (!theschema->IsClient(Unit()->Name())) {
+ stop = Standard_True;
+ }
+ }
+ else if (WOKernel_IsEngine(Unit())) {
+ if (!theschema->IsEngine(Unit()->Name())) {
+ stop = Standard_True;
+ }
+ }
+ else if (WOKernel_IsExecutable(Unit())) {
+ if (!theschema->IsExecutable(Unit()->Name())) {
+ stop = Standard_True;
+ }
+ }
+ else if (WOKernel_IsServer(Unit())) {
+ if (!theschema->IsComponent(Unit()->Name())) {
+ stop = Standard_True;
+ }
+ }
+ if (stop) {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Unit and cdl file definition type mismatch for unit " << Unit()->Name() << endm;
+ }
+ }
+
+
+ Handle(WOKernel_File) anent;
+
+ aseq = WOKBuilder_MSTool::GetMSchema()->GetEntityTypes(Unit()->Name());
+
+ for(i=1; i<=aseq->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ anent = Locator()->Locate(Unit()->Name(), sourcetype, WOKBuilder_MSTool::GetMSchema()->AssociatedFile(aseq->Value(i)));
+ if(!anent.IsNull())
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(anent->LocatorName(),
+ anent,
+ Handle(WOKBuilder_Entity)(), anent->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ AddExecDepItem(PKCDL, outfile, Standard_True);
+ }
+ }
+
+ if(stop)
+ SetFailed();
+ else
+ SetSucceeded();
+ return;
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_CDLUnitSource::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(WOKernel_File) FILES = GetFILES();
+ Handle(WOKernel_File) PKCDL = GetUnitDescr();
+
+ if(execlist->Length())
+ {
+ Standard_Integer i;
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ if(!strcmp(execlist->Value(i)->File()->Name()->ToCString(), FILES->Name()->ToCString()))
+ {
+ ReadFILES(execlist->Value(i));
+ }
+ if(!strcmp(execlist->Value(i)->File()->Name()->ToCString(), PKCDL->Name()->ToCString()))
+ {
+ ReadFILES(execlist->Value(i));
+ }
+ }
+ }
+ else
+ {
+ if(!FILES.IsNull())
+ {
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(FILES->LocatorName(), FILES,
+ Handle(WOKBuilder_Entity)(), FILES->Path());
+ execlist->Append(infile);
+ infile->SetDirectFlag(Standard_True);
+ infile->SetLocateFlag(Standard_True);
+
+ ReadFILES(infile);
+ }
+
+ if(CheckStatus("FILES reading")) return;
+ if(!PKCDL.IsNull())
+ {
+ Handle(WOKBuilder_Specification) cdlent = new WOKBuilder_CDLFile(PKCDL->Path());
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(PKCDL->LocatorName(), PKCDL,
+ cdlent , PKCDL->Path());
+ execlist->Append(infile);
+ infile->SetDirectFlag(Standard_True);
+ infile->SetLocateFlag(Standard_True);
+ ReadUnitDescr(infile);
+ }
+ if(CheckStatus("CDL processing")) return;
+ }
+ return;
+}
--- /dev/null
+-- File: WOKStep_ClientExtract.cdl
+-- Created: Thu Jun 27 17:20:15 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class ClientExtract from WOKStep
+inherits Extract from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ClientExtract from WOKStep;
+
+ HandleInputFile(me; infile : InputFile from WOKMake)
+ returns Boolean from Standard;
+
+ Init(me:mutable)
+ is redefined protected;
+
+ GetInputFlow(me:mutable)
+ is redefined protected;
+
+ OutOfDateEntities(me:mutable)
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined ;
+
+end ClientExtract;
--- /dev/null
+// File: WOKStep_ClientExtract.cxx
+// Created: Tue Aug 29 21:41:04 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <Standard_ProgramError.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapIteratorOfMapOfHAsciiString.hxx>
+
+#include <WOKUtils_Shell.hxx>
+#include <WOKUtils_Path.hxx>
+
+#include <MS.hxx>
+
+#include <WOKBuilder_MSClientExtractor.hxx>
+#include <WOKBuilder_MSActionID.hxx>
+#include <WOKBuilder_MSAction.hxx>
+#include <WOKBuilder_MSchema.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_Command.hxx>
+#include <WOKBuilder_MSExtractorIterator.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKStep_ClientExtract.ixx>
+
+
+//=======================================================================
+//function : WOKStep_ClientExtract
+//purpose :
+//=======================================================================
+WOKStep_ClientExtract::WOKStep_ClientExtract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Extract(abp, aunit, acode, checked, hidden)
+{
+ Handle(WOKBuilder_MSClientExtractor) anextractor = new WOKBuilder_MSClientExtractor(Unit()->Params());
+ anextractor->SetMSchema(WOKBuilder_MSTool::GetMSchema());
+ SetExtractor(anextractor);
+}
+
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_ClientExtract::HandleInputFile(const Handle(WOKMake_InputFile)& infile) const
+{
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("CPPClient_COMPLETE", infile->ID()->Token(":",2)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ return Standard_True;
+ }
+ if(!strcmp("CPPClient_INCOMPLETE", infile->ID()->Token(":",2)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ return Standard_True;
+ }
+ if(!strcmp("CPPClient_SEMICOMPLETE", infile->ID()->Token(":",2)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ return Standard_True;
+ }
+
+ }
+ return Standard_False;
+
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Init
+//purpose :
+//=======================================================================
+void WOKStep_ClientExtract::Init()
+{
+ Handle(WOKBuilder_MSClientExtractor) extr = Handle(WOKBuilder_MSClientExtractor)::DownCast(Extractor());
+
+ if(IsToExecute())
+ {
+ extr->Load();
+ extr->Init(Unit()->Name());
+ }
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : GetInputFlow
+//purpose :
+//=======================================================================
+void WOKStep_ClientExtract::GetInputFlow()
+{
+ static Handle(TCollection_HAsciiString) COMP = new TCollection_HAsciiString("CPPClient_COMPLETE");
+ static Handle(TCollection_HAsciiString) ICOMP = new TCollection_HAsciiString("CPPClient_INCOMPLETE");
+ static Handle(TCollection_HAsciiString) SCOMP = new TCollection_HAsciiString("CPPClient_SEMICOMPLETE");
+
+ Handle(WOKernel_File) NULLFILE;
+ Handle(WOKUtils_Path) NULLPATH;
+ Handle(WOKBuilder_Entity) NULLENT;
+
+ Handle(WOKBuilder_MSClientExtractor) ext = Handle(WOKBuilder_MSClientExtractor)::DownCast(Extractor());
+
+ //WOKMake_Step::GetInputFlow();
+
+ WOKTools_MapIteratorOfMapOfHAsciiString cit(ext->CompleteTypes());
+
+ while(cit.More())
+ {
+
+ Handle(TCollection_HAsciiString) id = WOKernel_File::FileLocatorName(Unit()->Name(), COMP, cit.Key());
+
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(id, NULLFILE,NULLENT, NULLPATH);
+
+ infile->SetLocateFlag(Standard_True);
+ infile->SetDirectFlag(Standard_True);
+ infile->SetPhysicFlag(Standard_False);
+
+ if(HandleInputFile(infile))
+ {
+ myinflow.Add(infile->ID(), infile);
+ }
+ cit.Next();
+ }
+
+ WOKTools_MapIteratorOfMapOfHAsciiString iit(ext->IncompleteTypes());
+
+ while(iit.More())
+ {
+
+ Handle(TCollection_HAsciiString) id = WOKernel_File::FileLocatorName(Unit()->Name(), ICOMP, iit.Key());
+
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(id, NULLFILE,NULLENT, NULLPATH);
+
+ infile->SetLocateFlag(Standard_True);
+ infile->SetDirectFlag(Standard_True);
+ infile->SetPhysicFlag(Standard_False);
+
+ if(HandleInputFile(infile))
+ {
+ myinflow.Add(infile->ID(), infile);
+ }
+ iit.Next();
+ }
+
+ WOKTools_MapIteratorOfMapOfHAsciiString sit(ext->SemiCompleteTypes());
+ while(sit.More())
+ {
+
+ Handle(TCollection_HAsciiString) id = WOKernel_File::FileLocatorName(Unit()->Name(), SCOMP, sit.Key());
+
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(id, NULLFILE,NULLENT, NULLPATH);
+
+ infile->SetLocateFlag(Standard_True);
+ infile->SetDirectFlag(Standard_True);
+ infile->SetPhysicFlag(Standard_False);
+
+ if(HandleInputFile(infile))
+ {
+ myinflow.Add(infile->ID(), infile);
+ }
+ sit.Next();
+ }
+
+}
+
+//=======================================================================
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_ClientExtract::OutOfDateEntities()
+{
+ Handle(WOKMake_HSequenceOfInputFile) result = new WOKMake_HSequenceOfInputFile;
+ Standard_Integer i;
+
+ LoadDependencies();
+
+ Handle(WOKBuilder_MSchema) ameta = Extractor()->MSchema();
+
+ for(i=1; i<=myinflow.Extent(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = myinflow(i);
+ Handle(WOKBuilder_MSEntity) anent = Handle(WOKBuilder_MSEntity)::DownCast(infile->BuilderEntity());
+
+ if(anent.IsNull())
+ {
+ ErrorMsg << "WOKStep_ClientExtract::OutOfDateEntities"
+ << infile->ID() << " is not a MS Entity" << endm;
+ SetFailed();
+ return result;
+ }
+
+ WOKBuilder_MSActionID anid(anent->Name(), Extractor()->ExtractorID());
+
+ Handle(WOKBuilder_MSAction) anaction = ameta->GetAction(anid);
+
+ switch(Extractor()->ExtractionStatus(anaction))
+ {
+ case WOKBuilder_OutOfDate:
+ result->Append(infile);
+ break;
+ case WOKBuilder_UpToDate:
+ break;
+ case WOKBuilder_NotDefined:
+ SetFailed();
+ return result;
+ }
+ }
+ return result;
+}
+
+
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_ClientExtract::Execute(const Handle(WOKMake_HSequenceOfInputFile)& tobuild)
+{
+ Standard_Integer i,j;
+
+ // Used Types
+ Handle(WOKernel_FileType) sourcetype = Unit()->GetFileType("source");
+ Handle(WOKernel_FileType) privincludetype = Unit()->GetFileType("privinclude");
+ Handle(WOKernel_FileType) pubincludetype = Unit()->GetFileType("pubinclude");
+ Handle(WOKernel_FileType) derivatedtype = Unit()->GetFileType("derivated");
+ Handle(WOKernel_FileType) englispfiletype = Unit()->GetFileType("englisp");
+
+ Handle(WOKBuilder_Command) acmd = new WOKBuilder_Command(new TCollection_HAsciiString("COMMAND"), Unit()->Params());
+ Handle(WOKUtils_Shell) ashell = Shell();
+
+ ashell->Lock();
+ acmd->SetShell(ashell);
+
+ Handle(WOKernel_File) outfile, basefile;
+ Extractor()->Load();
+ Extractor()->SetOutputDir(OutputDir());
+
+ WOKBuilder_MSExtractorIterator anit(WOKBuilder_MSTool::GetMSchema(), Extractor());
+
+ for(j=1; j<=tobuild->Length(); j++)
+ {
+
+ Handle(WOKBuilder_MSEntity) entity = Handle(WOKBuilder_MSEntity)::DownCast(tobuild->Value(j)->BuilderEntity());
+ Handle(TCollection_HAsciiString) amode = tobuild->Value(j)->ID()->Token(":", 2);
+
+ switch(anit.Execute(entity, amode->ToCString()))
+ {
+ case WOKBuilder_Success:
+ {
+ WOK_TRACE {
+ if(VerboseMsg("WOK_EXTRACT").IsSet())
+ {
+ VerboseMsg << "WOKStep_Extract::Execute"
+ << entity->Name() << " produces : " << endm;
+ for(i=1; i<=anit.Produces()->Length(); i++)
+ {
+ VerboseMsg << "WOKStep_Extract::Execute"
+ << "\t\t" << anit.Produces()->Value(i)->Path()->Name() << endm;
+ }
+ }
+ }
+
+ WOKBuilder_MSActionID anid(entity->Name(), WOKBuilder_ClientExtract);
+ Handle(WOKBuilder_MSAction) anaction = Extractor()->MSchema()->GetAction(anid);
+ Handle(WOKBuilder_Entity) outent;
+
+ Extractor()->MSchema()->ChangeAddAction(anid, Handle(WOKBuilder_Specification)());
+
+ for(i=1; i<=anit.Produces()->Length(); i++)
+ {
+ Standard_Boolean istemplate = Standard_False;
+
+ outent = anit.Produces()->Value(i);
+ switch(outent->Path()->Extension())
+ {
+ case WOKUtils_HXXFile:
+ // a .hxx file is a public include
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), pubincludetype);
+ break;
+ case WOKUtils_IXXFile:
+ case WOKUtils_JXXFile:
+ case WOKUtils_DDLFile:
+ // Private includes
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), privincludetype);
+ break;
+ case WOKUtils_CXXFile:
+ // Devivated Cxx file
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), derivatedtype);
+ break;
+ case WOKUtils_DATFile:
+ // Derivated datafile
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), derivatedtype);
+ break;
+ case WOKUtils_LispFile:
+ // Engine Lisp File
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), englispfiletype);
+ break;
+ case WOKUtils_TemplateFile:
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), sourcetype);
+ istemplate = Standard_True;
+ break;
+ }
+
+ outfile->GetPath();
+ basefile = Locator()->Locate(Unit()->Name(), outfile->TypeName(), outfile->Name());
+
+ WOKBuilder_BuildStatus astatus = WOKBuilder_Unbuilt;
+
+ if(basefile.IsNull())
+ {
+ // pas encore de Fichier : Simply Move
+ astatus = acmd->Move(outent->Path(), outfile->Path());
+ }
+ else
+ {
+ if(!outent->Path()->IsSameFile(basefile->Path()))
+ {
+ astatus = acmd->Move(outent->Path(), outfile->Path());
+ }
+ //astatus = acmd->ReplaceIfChangedWith(outent->Path(), basefile->Path(), outfile->Path());
+ }
+
+ Handle(WOKMake_OutputFile) out;
+
+ switch(astatus)
+ {
+ case WOKBuilder_Success:
+ outent->SetPath(outfile->Path());
+ out = new WOKMake_OutputFile(outfile->LocatorName(), outfile, outent, outfile->Path());
+ out->SetLocateFlag(Standard_True);
+ out->SetProduction();
+ if(!istemplate) AddExecDepItem(tobuild->Value(j), out, Standard_True);
+
+ InfoMsg << "WOKStep_Extract::Execute" << "File : " << outfile->Path()->Name() << " is modified" << endm;
+ break;
+ case WOKBuilder_Unbuilt:
+ WOK_TRACE {
+ VerboseMsg("WOK_EXTRACT") << "WOKStep_Extract::Execute"
+ << "File : " << outfile->Path()->Name() << " is unchanged" << endm;
+ }
+
+ outent->SetPath(basefile->Path());
+ out = new WOKMake_OutputFile(basefile->LocatorName(), basefile, outent, basefile->Path());
+ out->SetLocateFlag(Standard_True);
+ out->SetProduction();
+ if(!istemplate) AddExecDepItem(tobuild->Value(j), out, Standard_True);
+ break;
+ case WOKBuilder_Failed:
+ SetFailed();
+ ErrorMsg << "WOKStep_Extract::Execute" << "Failed : " << outfile->Name() << endm;
+ break;
+ }
+ }
+ }
+ break;
+ case WOKBuilder_Failed:
+ ErrorMsg << "WOKStep_Extract::Execute" << "Failed : " << entity->Name() << endm;
+ break;
+ }
+ }
+
+ ashell->UnLock();
+
+ if(Status() == WOKMake_Unprocessed) SetSucceeded();
+ return;
+}
--- /dev/null
+-- File: WOKStep_CodeGenerate.cdl
+-- Created: Thu Jul 11 23:23:17 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class CodeGenerate from WOKStep
+inherits ProcessStep from WOKStep
+ ---Purpose: Compile files
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ CodeGeneratorIterator from WOKBuilder,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection,
+ DataMapOfHAsciiStringOfFile from WOKernel
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable CodeGenerate from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ Init(me:mutable)
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ ---Purpose: 1 - Adds File In list if file is compilable or an admfile
+ -- 2 - Sets Build Flag if file is a compilable
+ returns Boolean from Standard
+ is redefined protected;
+
+ OutOfDateEntities(me:mutable)
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+fields
+
+ myiterator : CodeGeneratorIterator from WOKBuilder;
+
+end CodeGenerate;
--- /dev/null
+// File: WOKStep_CodeGenerate.cxx
+// Created: Thu Jul 11 23:24:17 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <TCollection_HAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Param.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKBuilder_CodeGenFile.hxx>
+#include <WOKBuilder_CodeGenerator.hxx>
+#include <WOKBuilder_CodeGeneratorIterator.hxx>
+#include <WOKBuilder_HSequenceOfToolInShell.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfStepOption.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_CodeGenerate.ixx>
+
+
+
+//=======================================================================
+//function : WOKStep_CodeGenerate
+//purpose :
+//=======================================================================
+WOKStep_CodeGenerate::WOKStep_CodeGenerate(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_ProcessStep(abp, aunit, acode, checked, hidden),
+ myiterator(new TCollection_HAsciiString("CODEGEN"), aunit->Params())
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_CodeGenerate::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)ADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_CodeGenerate::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)TMPDIR);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Init
+//purpose :
+//=======================================================================
+void WOKStep_CodeGenerate::Init()
+{
+ if(IsToExecute())
+ {
+ Handle(TCollection_HAsciiString) optline;
+
+ if(myiterator.LoadGroup())
+ {
+ ErrorMsg << "WOKStep_CodeGenerate::Init"
+ << "Could not load code generators definition" << endm;
+ SetFailed();
+ return;
+ }
+ }
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_CodeGenerate::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ }
+ else if(!infile->LastPath().IsNull())
+ {
+ apath = infile->LastPath();
+ }
+
+ if(!apath.IsNull())
+ {
+ if(myiterator.IsTreatedExtension(apath->ExtensionName()))
+ {
+ result = new WOKBuilder_CodeGenFile(apath);
+ }
+ else
+ return Standard_False;
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_CodeGenerate::OutOfDateEntities()
+{
+ return WOKMake_Step::OutOfDateEntities();
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_CodeGenerate::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i,j;
+ Handle(WOKMake_InputFile) infile;
+ Handle(WOKMake_OutputFile) outfile;
+ Handle(WOKMake_HSequenceOfInputFile) fails = new WOKMake_HSequenceOfInputFile;
+ Handle(WOKMake_HSequenceOfInputFile) succeeds = new WOKMake_HSequenceOfInputFile;
+ Handle(WOKernel_FileType) drvfile = Unit()->FileTypeBase()->Type("drvfile");
+ Handle(WOKernel_FileType) pubinclude = Unit()->FileTypeBase()->Type("pubinclude");
+ Handle(WOKernel_FileType) source = Unit()->FileTypeBase()->Type("source");
+ Handle(WOKernel_File) aoutfile;
+
+
+ // Obtention d'un shell
+ Handle(WOKUtils_Shell) ashell = Shell();
+
+ ashell->Lock();
+
+ myiterator.Init(ashell, OutputDir());
+
+ for(j=1; j<=execlist->Length(); j++)
+ {
+ infile = execlist->Value(j);
+
+ Handle(WOKBuilder_CodeGenFile) codegen = Handle(WOKBuilder_CodeGenFile)::DownCast(infile->BuilderEntity());
+
+ if(infile->File()->Nesting()->IsSameString(Unit()->FullName()))
+ {
+ InfoMsg << "WOKStep_CodeGenerate::Execute" << "-------> " << infile->File()->Name() << endm;
+ }
+ else
+ {
+ InfoMsg << "WOKStep_CodeGenerate::Execute" << "-------> " << infile->File()->UserPathName() << endm;
+ }
+
+ switch(myiterator.Execute(codegen))
+ {
+ case WOKBuilder_Success:
+ WOK_TRACE {
+ if(VerboseMsg("WOK_CODEGEN").IsSet())
+ {
+ VerboseMsg << "WOKStep_CodeGenerate::Execute"
+ << codegen->Path()->Name() << " produces : " << endm;
+
+ for(i=1; i<=myiterator.Produces()->Length(); i++)
+ {
+ VerboseMsg << "WOKStep_CodeGenerate::Execute"
+ << "\t\t" << myiterator.Produces()->Value(i)->Path()->Name() << endm;
+ }
+ }
+ }
+
+ for(i=1; i<=myiterator.Produces()->Length(); i++)
+ {
+ Handle(WOKBuilder_Entity) outent = myiterator.Produces()->Value(i);
+ aoutfile.Nullify();
+
+ switch(outent->Path()->Extension())
+ {
+ case WOKUtils_CFile:
+ case WOKUtils_CXXFile:
+ case WOKUtils_F77File:
+ aoutfile = new WOKernel_File(outent->Path()->FileName(), Unit(), drvfile );
+ break;
+ case WOKUtils_HFile:
+ case WOKUtils_HXXFile:
+ case WOKUtils_INCFile:
+ aoutfile = new WOKernel_File(outent->Path()->FileName(), Unit(), pubinclude);
+ break;
+ case WOKUtils_TemplateFile:
+ aoutfile = new WOKernel_File(outent->Path()->FileName(), Unit(), source);
+ default:
+ break;
+ }
+
+ if(aoutfile.IsNull())
+ {
+ ErrorMsg << "WOKStep_CodeGenerate::Execute"
+ << "Unrecognized file : " << outent->Path()->Name() << endm;
+ }
+ else
+ {
+ // je calcule le path de destination du file
+ aoutfile->GetPath();
+
+ // je l'y deplace
+ outent->Path()->MoveTo(aoutfile->Path());
+
+ outfile = new WOKMake_OutputFile(aoutfile->LocatorName(), aoutfile, outent, aoutfile->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+ succeeds->Append(infile);
+ break;
+ case WOKBuilder_Failed:
+ fails->Append(infile);
+ ErrorMsg << "WOKStep_CodeGenerate::Execute" << "Failed : " << infile->File()->Name() << endm;
+ break;
+ }
+ }
+
+ ashell->UnLock();
+
+ if(execlist->Length() == 0)
+ {
+ SetUptodate();
+ return;
+ }
+
+ if(fails->Length())
+ {
+ InfoMsg << "WOKStep_CodeGenerate::Execute"
+ << "----------------------- Compilation Report -----------------------" << endm;
+
+ for(i=1; i<= fails->Length(); i++)
+ {
+ InfoMsg << "WOKStep_CodeGenerate::Execute"
+ << "Failed : " << fails->Value(i)->File()->UserPathName() << endm;
+ }
+ InfoMsg << "WOKStep_CodeGenerate::Execute"
+ << "-----------------------------------------------------------------" << endm;
+ }
+
+ if(fails->Length() && succeeds->Length())
+ {
+ SetIncomplete();
+ return;
+ }
+ if(fails->Length())
+ {
+ SetFailed();
+ return;
+ }
+ SetSucceeded();
+ return;
+}
+
+
--- /dev/null
+-- File: WOKStep_Compile.cdl
+-- Created: Thu Jun 27 17:25:43 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class Compile from WOKStep
+inherits ProcessStep from WOKStep
+ ---Purpose: Compile files
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ CompilerIterator from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection,
+ DataMapOfHAsciiStringOfFile from WOKernel
+is
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable Compile from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ Init(me:mutable)
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ ---Purpose: 1 - Adds File In list if file is compilable or an admfile
+ -- 2 - Sets Build Flag if file is a compilable
+ returns Boolean from Standard
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+fields
+
+ myiterator : CompilerIterator from WOKBuilder;
+
+end Compile;
--- /dev/null
+// File: WOKStep_Compile.cxx
+// Created: Tue Aug 29 21:40:43 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <unistd.h>
+#include <fstream.h>
+
+#include <TCollection_HAsciiString.hxx>
+
+#include <TColStd_HArray2OfInteger.hxx>
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Param.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#ifndef WNT
+# include <WOKUtils_RemoteShell.hxx>
+#else
+# include <WOKUtils_Shell.hxx>
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+#include <WOKernel_Locator.hxx>
+
+
+#include <WOKBuilder_Compiler.hxx>
+#include <WOKBuilder_Compilable.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_MFile.hxx>
+#include <WOKBuilder_CompilerIterator.hxx>
+#include <WOKBuilder_HSequenceOfToolInShell.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfStepOption.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_Compile.ixx>
+
+//=======================================================================
+//function : WOKStep_Compile
+//purpose :
+//=======================================================================
+WOKStep_Compile::WOKStep_Compile(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_ProcessStep(abp,aunit, acode, checked, hidden),
+ myiterator(new TCollection_HAsciiString("CMPLRS"), aunit->Params())
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Compile::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Compile::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Init
+//purpose :
+//=======================================================================
+void WOKStep_Compile::Init()
+{
+ if(IsToExecute())
+ {
+
+ WOKStep_ProcessStep::Init();
+ // Set du debug mode
+ if(Unit()->Session()->DebugMode())
+ Unit()->Params().Set("%DebugMode", "True");
+ else
+ Unit()->Params().Set("%DebugMode", "False");
+
+#ifdef WNT
+ Handle(WOKernel_FileType) objtype = Unit()->FileTypeBase()->Type("object");
+ Handle(TCollection_HAsciiString) debugDef = new TCollection_HAsciiString();
+
+ Handle(WOKernel_File) pdbFile = new WOKernel_File(Unit()->Name(), Unit(), objtype);
+ pdbFile->GetPath();
+ Unit()->Params().Set("%PDBName", pdbFile->Path()->Name()->ToCString());
+#endif // WNT
+
+ if(myiterator.LoadGroup())
+ {
+ ErrorMsg << "WOKStep_Compile::Init"
+ << "Could not load compilers definition" << endm;
+ SetFailed();
+ return;
+ }
+ }
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_Compile::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ }
+ else if(!infile->LastPath().IsNull())
+ {
+ apath = infile->LastPath();
+ }
+
+ if(!apath.IsNull())
+ {
+ if(myiterator.IsTreatedExtension(apath->ExtensionName()))
+ {
+ result = new WOKBuilder_Compilable(apath);
+ }
+ else
+ return Standard_False;
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_Compile::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i,j;
+ Handle(WOKMake_InputFile) infile;
+ Handle(WOKMake_OutputFile) outfile;
+ Handle(WOKMake_HSequenceOfInputFile) fails = new WOKMake_HSequenceOfInputFile;
+ Handle(WOKMake_HSequenceOfInputFile) succeeds = new WOKMake_HSequenceOfInputFile;
+ Handle(WOKernel_FileType) objtype = Unit()->FileTypeBase()->Type("object");
+ Handle(WOKernel_FileType) mtype = Unit()->FileTypeBase()->Type("mfile");
+ Handle(WOKernel_File) aoutfile;
+
+ Handle(WOKUtils_HSequenceOfPath) incdirs = ComputeIncDirectories();
+ Handle(WOKUtils_HSequenceOfPath) dbdirs = ComputeDatabaseDirectories();
+
+ // Set du debug mode
+ // Obtention d'un shell
+ Handle(WOKUtils_Shell) ashell = Shell();
+
+ ashell->Lock();
+
+ myiterator.Init(ashell, OutputDir(), incdirs, dbdirs);
+
+ for(j=1; j<=execlist->Length(); j++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+
+ infile = execlist->Value(j);
+
+ Handle(WOKBuilder_Compilable) compilable = Handle(WOKBuilder_Compilable)::DownCast(infile->BuilderEntity());
+
+ if(infile->File()->Nesting()->IsSameString(Unit()->FullName()))
+ {
+ InfoMsg << "WOKStep_Compile::Execute" << "-------> " << infile->File()->Name() << endm;
+ }
+ else
+ {
+ InfoMsg << "WOKStep_Compile::Execute" << "-------> " << infile->File()->UserPathName() << endm;
+ }
+
+ switch(myiterator.Execute(compilable))
+ {
+ case WOKBuilder_Success:
+ WOK_TRACE {
+ if(VerboseMsg("WOK_COMPILE").IsSet())
+ {
+ VerboseMsg << "WOKStep_Compile::Execute"
+ << compilable->Path()->Name() << " produces : " << endm;
+ for(i=1; i<=myiterator.Produces()->Length(); i++)
+ {
+ VerboseMsg << "WOKStep_Compile::Execute"
+ << "\t\t" << myiterator.Produces()->Value(i)->Path()->Name() << endm;
+ }
+ }
+ }
+
+ TreatOutput(infile,myiterator.Produces());
+
+ succeeds->Append(infile);
+ break;
+ case WOKBuilder_Failed:
+ fails->Append(infile);
+ ErrorMsg << "WOKStep_Compile::Execute" << "Failed : " << infile->File()->Name() << endm;
+ break;
+ }
+ }
+
+ ashell->UnLock();
+
+ if(execlist->Length() == 0)
+ {
+ SetUptodate();
+ return;
+ }
+
+ if(fails->Length())
+ {
+ InfoMsg << "WOKStep_Compile::Execute"
+ << "----------------------- Compilation Report -----------------------" << endm;
+
+ for(i=1; i<= fails->Length(); i++)
+ {
+ InfoMsg << "WOKStep_Compile::Execute"
+ << "Failed : " << fails->Value(i)->File()->UserPathName() << endm;
+ }
+ InfoMsg << "WOKStep_Compile::Execute"
+ << "-----------------------------------------------------------------" << endm;
+ }
+
+ if(fails->Length() && succeeds->Length())
+ {
+ SetIncomplete();
+ return;
+ }
+ if(fails->Length())
+ {
+ SetFailed();
+ return;
+ }
+ SetSucceeded();
+ return;
+}
+
+
--- /dev/null
+-- File: WOKStep_ComputeLinkList.cdl
+-- Created: Tue Sep 3 20:42:48 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+deferred class ComputeLinkList from WOKStep
+inherits LinkList from WOKStep
+
+ ---Purpose:
+
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ MapOfHAsciiString from WOKTools,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Initialize( abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ComputeLinkList from WOKStep;
+
+ HandleInputFile(me:mutable; anitem : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+
+end ComputeLinkList;
--- /dev/null
+// File: WOKStep_ComputeLinkList.cxx
+// Created: Tue Sep 3 20:45:03 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+#include <WOKTools_MapIteratorOfMapOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_AdmFile.hxx>
+
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_Miscellaneous.hxx>
+
+#ifndef WNT
+# include <WOKBuilder_ArchiveLibrary.hxx>
+# include <WOKBuilder_SharedLibrary.hxx>
+#else
+# include <WOKNT_WNT_BREAK.hxx>
+# include <WOKBuilder_StaticLibrary.hxx>
+# include <WOKBuilder_ImportLibrary.hxx>
+#endif // WNT
+
+#include <WOKernel_Session.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+
+#include <WOKStep_ComputeLinkList.ixx>
+
+//=======================================================================
+//function : WOKStep_ComputeLinkList
+//purpose :
+//=======================================================================
+WOKStep_ComputeLinkList::WOKStep_ComputeLinkList(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_LinkList(abp,aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ComputeLinkList::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ComputeLinkList::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_ComputeLinkList::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKUtils_Path) apath;
+ Handle(WOKBuilder_Entity) result;
+
+ if(infile->IsStepID())
+ return Standard_True;
+
+ if(!infile->IsPhysic())
+ return Standard_True;
+
+ if(!infile->File().IsNull())
+ {
+
+ if(!strcmp(".ImplDep", infile->File()->Path()->ExtensionName()->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ result = new WOKBuilder_Miscellaneous(infile->File()->Path());
+ infile->SetBuilderEntity(result);
+ return Standard_True;
+ }
+
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_ObjectFile: result = new WOKBuilder_ObjectFile(apath); break;
+#ifndef WNT
+ case WOKUtils_ArchiveFile: result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_DSOFile: result = new WOKBuilder_SharedLibrary(apath); break;
+#else
+ case WOKUtils_IMPFile: result = new WOKBuilder_ImportLibrary(apath); break;
+ case WOKUtils_RESFile:
+ case WOKUtils_LIBFile: result = new WOKBuilder_StaticLibrary(apath); break;
+#endif // WNT
+ default:
+ return Standard_False;
+ }
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_ComputeLinkList::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist) {
+ Standard_Integer i,j;
+ Standard_Boolean failed = Standard_False;
+
+ Handle(TColStd_HSequenceOfHAsciiString) deplist, thelist = new TColStd_HSequenceOfHAsciiString;
+ Handle(WOKMake_InputFile) theinfile;
+
+ WOKTools_MapOfHAsciiString excludemap;
+
+ if(WOKernel_IsToolkit(Unit()))
+ {
+ Handle(TCollection_HAsciiString) pkgstype = new TCollection_HAsciiString("PACKAGES");
+ Handle(TCollection_HAsciiString) PACKAGESname = Unit()->Params().Eval("%FILENAME_PACKAGES");
+ Handle(WOKernel_File) PACKAGES = Locator()->Locate(Unit()->Name(), pkgstype, PACKAGESname);
+
+ if(PACKAGES.IsNull())
+ {
+ ErrorMsg << "WOKStep_ComputeLinkList::Execute"
+ << "Could not find PACKAGES file for toolkit : " << Unit()->Name() << endm;
+ SetFailed();
+ return;
+ }
+ else
+ {
+ WOKUtils_AdmFile afile(PACKAGES->Path());
+ Handle(TColStd_HSequenceOfHAsciiString) udsoftk;
+
+ udsoftk = afile.Read();
+
+ if(udsoftk.IsNull())
+ {
+ ErrorMsg << "WOKStep_ComputeLinkList::Execute"
+ << "Could not read file " << PACKAGES->Path()->Name() << endm;
+ SetFailed();
+ return;
+ }
+
+ for(Standard_Integer j=1; j<=udsoftk->Length(); j++)
+ {
+
+ const Handle(WOKernel_DevUnit)& aunit = Locator()->LocateDevUnit(udsoftk->Value(j));
+
+ if(aunit.IsNull())
+ {
+ ErrorMsg << "WOKStep_ComputeLinkList::Execute"
+ << "Unknown unit (" << udsoftk->Value(j) << ") listed in PACKAGES of : " << Unit()->Name() << endm;
+ SetFailed();
+ return;
+ }
+ else
+ excludemap.Add(aunit->Name());
+ ComputeExternals(aunit->Name());
+ }
+ }
+ }
+
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+#ifdef WNT
+ _TEST_BREAK();
+#endif // WNT
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+
+ if(infile->IsPhysic())
+ {
+ if(infile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_Miscellaneous)))
+ {
+ theinfile = infile;
+ Handle(TColStd_HSequenceOfHAsciiString) list;
+
+ list = Unit()->ReadImplDepFile(infile->File()->Path(), Locator());
+
+ for(j=1; j<=list->Length(); j++)
+ thelist->Append(list->Value(j));
+ }
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(infile);
+
+ outfile->SetReference();
+ outfile->SetExtern();
+
+ Handle(WOKernel_DevUnit) unit = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ if(!unit.IsNull())
+ {
+ if(!strcmp(unit->Name()->ToCString(), Unit()->Name()->ToCString()))
+ outfile->SetMember();
+ }
+
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ else
+ {
+ Handle(TCollection_HAsciiString) aunit = infile->ID()->Token(":", 1);
+ Handle(TCollection_HAsciiString) atype = infile->ID()->Token(":", 2);
+ Handle(TCollection_HAsciiString) aname = infile->ID()->Token(":", 3);
+
+ if(!strcmp(atype->ToCString(), "external"))
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(infile);
+ outfile->SetReference();
+
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ else if(!strcmp(atype->ToCString(), "mslibrary"))
+ {
+ Handle(WOKernel_DevUnit) unit = Locator()->LocateDevUnit(aunit);
+
+ if(unit.IsNull())
+ {
+ ErrorMsg << "WOKStep_ComputeExecList::Execute"
+ << "Cannot find the uses library unit " << aunit << endm;
+ SetFailed();
+ return;
+ }
+ else
+ {
+ Handle(WOKMake_OutputFile) outfile = GetUnitLibrary(unit);
+
+ if(!outfile.IsNull())
+ AddExecDepItem(infile, outfile, Standard_True);
+ else
+ {
+ SetFailed();
+ return;
+ }
+ }
+ }
+ }
+ }
+
+ if(theinfile.IsNull())
+ {
+ Handle(WOKMake_HSequenceOfInputFile) theinfiles = InputFileList();
+ for (Standard_Integer k=1; theinfile.IsNull() && (k<= theinfiles->Length()) ; k++) {
+ Handle(WOKMake_InputFile) aninfile = theinfiles->Value(k);
+ if(!aninfile->File().IsNull()) {
+ if(!strcmp(".ImplDep", aninfile->File()->Path()->ExtensionName()->ToCString())) {
+ theinfile = aninfile;
+ }
+ }
+ }
+ if (!theinfile.IsNull()) {
+ theinfile->File()->GetPath();
+ Handle(TColStd_HSequenceOfHAsciiString) list = Unit()->ReadImplDepFile(theinfile->File()->Path(), Locator());
+ for(j=1; j<=list->Length(); j++)
+ thelist->Append(list->Value(j));
+ }
+ else {
+ ErrorMsg << "WOKStep_ComputeExecList::Execute"
+ << "Cannot find the Input ImplDep file" << endm;
+ SetFailed();
+ return;
+ }
+ }
+
+ Handle(TCollection_HAsciiString) thename = new TCollection_HAsciiString(Unit()->Name());
+
+ if(!SubCode().IsNull())
+ {
+ thename->AssignCat("_");
+ thename->AssignCat(SubCode());
+ }
+
+ deplist = ComputeDependency( thename, thelist);
+
+ if(deplist.IsNull())
+ {
+ SetFailed();
+ return;
+ }
+
+
+ for(j=1; j<=deplist->Length(); j++)
+ {
+ ComputeExternals(deplist->Value(j));
+ }
+
+#ifdef WNT
+ // sur NT il faut linker la DLL du PK avec ses externals
+ ComputeExternals(Unit()->Name());
+#endif
+
+
+ for(i=deplist->Length(); i>=1; i--)
+
+ {
+#ifdef WNT
+ _TEST_BREAK();
+#endif // WNT
+
+ const Handle(TCollection_HAsciiString)& adep = deplist->Value(i);
+
+ if(!excludemap.Contains(adep))
+ {
+ AddUnitContribution(theinfile, adep);
+ }
+ }
+
+ if(failed) SetFailed();
+ else SetSucceeded();
+ return;
+}
--- /dev/null
+-- File: WOKStep_DLLink.cdl
+-- Created: Wed Oct 23 10:15:56 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+class DLLink from WOKStep inherits WNTLink from WOKStep
+
+ uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection,
+ HSequenceOfLibrary from WOKBuilder,
+ HSequenceOfHAsciiString from TColStd,
+ HSequenceOfInputFile from WOKMake,
+ WNTCollector from WOKBuilder
+
+ is
+
+ Create (
+ aBP : BuildProcess from WOKMake;
+ aUnit : DevUnit from WOKernel;
+ aCode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ ) returns mutable DLLink from WOKStep;
+ ---Purpose: creates a class instance
+
+ ComputeLibraryList (
+ me : mutable;
+ anInput : HSequenceOfInputFile from WOKMake
+ )
+ returns mutable HSequenceOfLibrary from WOKBuilder
+ is redefined static protected;
+ ---Purpose: computes library list to build a target
+
+ ComputeTool ( me : mutable )
+ returns mutable WNTCollector from WOKBuilder
+ is redefined static protected;
+ ---Purpose: computes build tool
+
+end DLLink;
--- /dev/null
+#include <WOKStep_DLLink.ixx>
+
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+
+#include <WOKBuilder_DLLinker.hxx>
+#include <WOKBuilder_ImportLibrary.hxx>
+#include <WOKBuilder_ExportLibrary.hxx>
+#include <WOKBuilder_MSTool.hxx>
+#include <WOKBuilder_MSchema.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Path.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_HSequenceOfInputFile.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#ifndef WNT
+# define FASTCALL
+#else
+# define FASTCALL __fastcall
+#endif // WNT
+
+Handle(WOKBuilder_Library)FASTCALL _get_unit_library(
+ Handle(WOKernel_DevUnit )&,
+ Handle(TCollection_HAsciiString)&,
+ Handle(TCollection_HAsciiString)&,
+ const WOKUtils_Param&,
+ Standard_Boolean = Standard_False
+ );
+
+//=======================================================================
+//function : WOKStep_DLLink
+//purpose :
+//=======================================================================
+WOKStep_DLLink::WOKStep_DLLink(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aUnit,
+ const Handle(TCollection_HAsciiString)& aCode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden
+ )
+ : WOKStep_WNTLink(abp, aUnit, aCode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : ComputeTool
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_WNTCollector) WOKStep_DLLink::ComputeTool()
+{
+ return new WOKBuilder_DLLinker(new TCollection_HAsciiString("LINK"), Unit()->Params());
+}
+
+//=======================================================================
+//function : ComputeLibraryList
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_HSequenceOfLibrary) WOKStep_DLLink::ComputeLibraryList(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i;
+ Handle(WOKernel_File) alib;
+ Handle(WOKernel_DevUnit) aunit;
+ Handle(WOKernel_UnitNesting) anesting;
+ Handle(WOKBuilder_ImportLibrary) ashlib;
+ Handle(TCollection_HAsciiString) libname;
+ Handle(WOKBuilder_HSequenceOfLibrary) aseq = new WOKBuilder_HSequenceOfLibrary;
+ static Handle(TCollection_HAsciiString) libtype = new TCollection_HAsciiString("library");
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKBuilder_Entity) anent = infile->BuilderEntity();
+ Handle(WOKBuilder_Library) library;
+
+ library = Handle(WOKBuilder_Library)::DownCast(anent);
+
+ if(!library.IsNull())
+ {
+ aunit = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ anesting = aunit->Session()->GetUnitNesting(aunit->Nesting());
+
+ if(!infile->File().IsNull())
+ {
+ libname = infile->File()->Path()->FileName();
+
+ if(infile->IsLocateAble())
+ {
+ alib = Locator()->Locate(aunit->Name(), libtype, libname);
+
+ if(alib.IsNull())
+ {
+ ErrorMsg << "WOKStep_Link::ComputeLibraryList"
+ << "Could not find library in unit : " << aunit->UserPathName() << endm;
+ SetFailed();
+ }
+
+ ashlib = new WOKBuilder_ImportLibrary(alib->Path());
+ }
+ }
+ else
+ {
+ ashlib = new WOKBuilder_ImportLibrary(library->Path());
+ }
+
+ if(!ashlib.IsNull()) {aseq->Append(ashlib);ashlib.Nullify();}
+
+ }
+ }
+
+ return aseq;
+}
+
+Handle(WOKBuilder_Library)FASTCALL _get_unit_library(
+ Handle(WOKernel_DevUnit )& unit,
+ Handle(TCollection_HAsciiString)& libPath,
+ Handle(TCollection_HAsciiString)& libName,
+ const WOKUtils_Param& params,
+ Standard_Boolean fExport
+ ){
+
+ WOKBuilder_LibReferenceType refType;
+
+ Handle(WOKBuilder_Library)retVal;
+ Handle(WOKernel_UnitNesting)nesting;
+
+ nesting = unit->Session()->GetUnitNesting(unit->Nesting());
+
+ if( nesting->IsKind(STANDARD_TYPE(WOKernel_Workbench)))
+
+ refType = WOKBuilder_FullPath;
+
+ else if( nesting->IsKind(STANDARD_TYPE(WOKernel_Parcel)))
+
+ refType = WOKBuilder_LongRef;
+
+ else {
+
+ WarningMsg << "_get_unit_library"
+ << "Unknown nesting for " << unit->UserPathName() << endm;
+
+ return retVal;
+
+ } // end else
+
+ if(fExport)
+
+ retVal = new WOKBuilder_ExportLibrary(
+ libName, new WOKUtils_Path(libPath), refType
+ );
+
+ else
+
+ retVal = new WOKBuilder_ImportLibrary(
+ libName, new WOKUtils_Path(libPath), refType
+ );
+
+
+ libPath->AssignCat( retVal->GetLibFileName(params));
+
+ retVal->SetPath(new WOKUtils_Path(libPath));
+
+ return retVal;
+
+} // end _get_unit_library
--- /dev/null
+-- File: WOKStep_DirectLinkList.cdl
+-- Created: Tue Dec 2 18:20:54 1997
+-- Author: Jean GAUTIER
+-- <jga@hourax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+
+class DirectLinkList from WOKStep
+inherits ComputeLinkList from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Create( abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable DirectLinkList from WOKStep;
+
+
+ ComputeDependency(me; code : HAsciiString from TCollection; adirectlist : HSequenceOfHAsciiString from TColStd)
+ returns HSequenceOfHAsciiString from TColStd is redefined protected;
+
+end DirectLinkList;
--- /dev/null
+// File: WOKStep_DirectLinkList.cxx
+// Created: Tue Dec 2 18:22:53 1997
+// Author: Jean GAUTIER
+// <jga@hourax.paris1.matra-dtv.fr>
+
+#include <WOKStep_DirectLinkList.ixx>
+
+
+//=======================================================================
+//function : WOKStep_DirectLinkList
+//purpose :
+//=======================================================================
+ WOKStep_DirectLinkList::WOKStep_DirectLinkList(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_ComputeLinkList(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//function : ComputeDependency
+//purpose :
+//=======================================================================
+Handle(TColStd_HSequenceOfHAsciiString) WOKStep_DirectLinkList::ComputeDependency(const Handle(TCollection_HAsciiString)& acode,
+ const Handle(TColStd_HSequenceOfHAsciiString)& directlist) const
+{
+ return directlist;
+}
--- /dev/null
+-- File: WOKStep_DirectTKReplace.cdl
+-- Created: Tue Dec 2 18:20:54 1997
+-- Author: Jean GAUTIER
+-- <jga@hourax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+
+class DirectTKReplace from WOKStep
+inherits TKReplace from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Create( abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable DirectTKReplace from WOKStep;
+
+
+ ComputeDependency(me; code : HAsciiString from TCollection; adirectlist : HSequenceOfHAsciiString from TColStd)
+ returns HSequenceOfHAsciiString from TColStd is redefined protected;
+
+end DirectTKReplace;
+
--- /dev/null
+// File: WOKStep_DirectTKReplace.cxx
+// Created: Tue Dec 2 18:22:53 1997
+// Author: Jean GAUTIER
+// <jga@hourax.paris1.matra-dtv.fr>
+
+#include <WOKStep_DirectTKReplace.ixx>
+
+
+//=======================================================================
+//function : WOKStep_DirectTKReplace
+//purpose :
+//=======================================================================
+ WOKStep_DirectTKReplace::WOKStep_DirectTKReplace(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_TKReplace(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//function : ComputeDependency
+//purpose :
+//=======================================================================
+Handle(TColStd_HSequenceOfHAsciiString) WOKStep_DirectTKReplace::ComputeDependency(const Handle(TCollection_HAsciiString)& acode,
+ const Handle(TColStd_HSequenceOfHAsciiString)& directlist) const
+{
+ Handle(TColStd_HSequenceOfHAsciiString) ret = new TColStd_HSequenceOfHAsciiString();
+ return ret;
+}
--- /dev/null
+-- File: WOKStep_DynamicLibrary.cdl
+-- Created: Thu Jun 27 17:30:39 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class DynamicLibrary from WOKStep
+inherits Library from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable DynamicLibrary from WOKStep;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ ComputeDatabaseDirectories(me)
+ returns HSequenceOfPath from WOKUtils is protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end DynamicLibrary;
--- /dev/null
+// File: WOKStep_DynamicLibrary.cxx
+// Created: Tue Aug 29 21:40:53 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_HSequenceOfObjectFile.hxx>
+#include <WOKBuilder_HSequenceOfLibrary.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_SharedLinker.hxx>
+#include <WOKBuilder_SharedLibrary.hxx>
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_Miscellaneous.hxx>
+
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_Workbench.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfInputFile.hxx>
+
+#include <WOKStep_DynamicLibrary.ixx>
+
+//=======================================================================
+//function : WOKStep_DynamicLibrary
+//purpose :
+//=======================================================================
+WOKStep_DynamicLibrary::WOKStep_DynamicLibrary(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Library(abp,aunit,acode,checked,hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_DynamicLibrary::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_ObjectFile: result = new WOKBuilder_ObjectFile(apath); break;
+ case WOKUtils_ArchiveFile: result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_DSOFile: result = new WOKBuilder_SharedLibrary(apath); break;
+ default:
+ return Standard_False;
+ }
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : ComputeDatabaseDirectories
+//purpose :
+//=======================================================================
+Handle(WOKUtils_HSequenceOfPath) WOKStep_DynamicLibrary::ComputeDatabaseDirectories() const
+{
+ Handle(WOKUtils_HSequenceOfPath) aseq;
+
+ if(Unit()->Params().Eval("%WOKSteps_UseDatabaseDirectory").IsNull())
+ {
+ return aseq;
+ }
+
+ Handle(TColStd_HSequenceOfHAsciiString) nestingseq = Unit()->Session()->GetWorkbench(Unit()->Nesting())->Visibility();
+ Handle(TCollection_HAsciiString) aname;
+ Handle(WOKernel_File) afile;
+ Handle(WOKernel_FileType) atype;
+ Handle(WOKernel_DevUnit) aunit;
+ Handle(TCollection_HAsciiString) DOT = new TCollection_HAsciiString(".");
+ WOKTools_MapOfHAsciiString amap;
+ Standard_Integer i;
+
+ aseq = new WOKUtils_HSequenceOfPath;
+
+ for(i=1; i<=nestingseq->Length(); i++)
+ {
+ Handle(WOKernel_UnitNesting) nesting = Unit()->Session()->GetUnitNesting(nestingseq->Value(i));
+ // les wbs uniquement
+ if(nesting->IsKind(STANDARD_TYPE(WOKernel_Workbench))) {
+ atype = nesting->FileTypeBase()->Type("libdir");
+ afile = new WOKernel_File(DOT, nesting, atype);
+ afile->GetPath();
+ if(!amap.Contains(afile->Path()->Name()))
+ {
+ aseq->Append(afile->Path());
+ amap.Add(afile->Path()->Name());
+ }
+ }
+ }
+
+ return aseq;
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_DynamicLibrary::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(WOKBuilder_HSequenceOfObjectFile) objseq = new WOKBuilder_HSequenceOfObjectFile;
+ Handle(WOKBuilder_HSequenceOfLibrary) libseq = new WOKBuilder_HSequenceOfLibrary;
+ Handle(WOKBuilder_ObjectFile) anobject;
+ Handle(WOKernel_FileType) libtype = Unit()->GetFileType("library");
+ Handle(WOKernel_FileType) stadmtype = Unit()->GetFileType("stadmfile");
+ Handle(WOKBuilder_Library) alib;
+ Handle(TCollection_HAsciiString) libname;
+ Handle(TCollection_HAsciiString) bidname;
+ Standard_Integer i,j;
+
+ Handle(WOKBuilder_SharedLinker) ldshr = new WOKBuilder_SharedLinker(new TCollection_HAsciiString("LDSHR"),
+ Unit()->Params());
+
+ Handle(WOKUtils_Shell) ashell = Shell();
+
+ ashell->Lock();
+ ldshr->SetShell(ashell);
+
+ ldshr->SetOutputDir(OutputDir());
+
+ for(j=1; j<=execlist->Length(); j++)
+ {
+ anobject = Handle(WOKBuilder_ObjectFile)::DownCast(execlist->Value(j)->BuilderEntity());
+
+ if(!anobject.IsNull())
+ {
+ objseq->Append(anobject);
+ }
+
+ alib= Handle(WOKBuilder_Library)::DownCast(execlist->Value(j)->BuilderEntity());
+
+ if(!alib.IsNull())
+ {
+ libseq->Append(alib);
+ }
+ }
+
+ ldshr->SetObjectList(objseq);
+ ldshr->SetLibraryList(libseq);
+ ldshr->SetDatabaseDirectories(ComputeDatabaseDirectories());
+
+ // Calcul du soname
+ Handle(WOKUtils_Path) apath;
+
+ alib = new WOKBuilder_SharedLibrary(Unit()->Name(), apath, WOKBuilder_FullPath);
+ libname = alib->GetLibFileName(Unit()->Params());
+
+ ldshr->SetLogicalName(libname);
+
+ // TargetName
+ if(SubCode().IsNull())
+ {
+ ldshr->SetTargetName(Unit()->Name());
+ }
+ else
+ {
+ ldshr->SetTargetName(SubCode());
+ }
+
+ // Externals is Empty in this Step
+ ldshr->SetExternals(new TColStd_HSequenceOfHAsciiString);
+
+ InfoMsg << "WOKStep_DynamicLibrary::Execute"
+ << "Creating : " << libname << endm;
+
+
+ switch(ldshr->Execute())
+ {
+ case WOKBuilder_Success:
+ for(i=1; i<=ldshr->Produces()->Length(); i++)
+ {
+ Handle(WOKBuilder_Entity) outent = ldshr->Produces()->Value(i);
+ Handle(WOKernel_File) outitem;
+ Handle(WOKMake_OutputFile) outfile;
+
+ if(outent->IsKind(STANDARD_TYPE(WOKBuilder_Miscellaneous)))
+ {
+ outitem = new WOKernel_File(outent->Path()->FileName(), Unit(), stadmtype);
+ }
+ else
+ {
+ switch(outent->Path()->Extension())
+ {
+ case WOKUtils_DSOFile:
+ outitem = new WOKernel_File(outent->Path()->FileName(), Unit(), libtype);
+ break;
+ default:
+ ErrorMsg << "WOKStep_DynamicLibrary::Execute"
+ << "Unrecognized production : " << outent->Path()->FileName() << endm;
+ SetFailed();
+ return;
+ }
+ }
+
+ if(!outitem.IsNull())
+ {
+ outitem->GetPath();
+
+ outent->Path()->MoveTo(outitem->Path());
+
+ outfile = new WOKMake_OutputFile(outitem->LocatorName(), outitem, outent, outitem->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+
+ for(j=1; j<=execlist->Length(); j++)
+ {
+ AddExecDepItem(execlist->Value(j), outfile, Standard_True);
+ }
+ }
+ }
+ InfoMsg << "WOKStep_DynamicLibrary::Execute"
+ << "Succeeded : " << libname << endm;
+ SetSucceeded();
+ break;
+ case WOKBuilder_Failed:
+ ErrorMsg << "WOKStep_DynamicLibrary::Execute"
+ << "Failed : " << libname << endm;
+ SetFailed();
+ break;
+ }
+
+ ashell->UnLock();
+ return;
+}
+
--- /dev/null
+-- File: WOKStep_EXELink.cdl
+-- Created: Wed Oct 30 09:31:41 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+class EXELink from WOKStep inherits WNTLink from WOKStep
+
+ uses
+
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection,
+ HSequenceOfLibrary from WOKBuilder,
+ HSequenceOfHAsciiString from TColStd,
+ HSequenceOfInputFile from WOKMake,
+ HSequenceOfObjectFile from WOKBuilder,
+ WNTCollector from WOKBuilder
+
+ is
+
+ Create (
+ abp : BuildProcess from WOKMake;
+ aUnit : DevUnit from WOKernel;
+ aCode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ ) returns mutable EXELink from WOKStep;
+ ---Purpose: creates a class instance
+
+ ComputeObjectList (
+ me : mutable;
+ anInput : HSequenceOfInputFile from WOKMake
+ )
+ returns mutable HSequenceOfObjectFile from WOKBuilder
+ is redefined static protected;
+ ---Purpose: computes object list to build
+
+ ComputeLibraryList (
+ me : mutable;
+ anInput : HSequenceOfInputFile from WOKMake
+ )
+ returns mutable HSequenceOfLibrary from WOKBuilder
+ is redefined static protected;
+ ---Purpose: computes library list to build a target
+
+ ComputeTool ( me : mutable )
+ returns mutable WNTCollector from WOKBuilder
+ is redefined static protected;
+ ---Purpose: computes build tool
+
+end EXELink;
--- /dev/null
+
+
+
+#include <WOKStep_EXELink.ixx>
+
+#include <WOKBuilder_EXELinker.hxx>
+#include <WOKBuilder_MSTool.hxx>
+#include <WOKBuilder_MSchema.hxx>
+#include <WOKBuilder_Entity.hxx>
+#include <WOKBuilder_Library.hxx>
+#include <WOKBuilder_ImportLibrary.hxx>
+
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_UnitGraph.hxx>
+
+#include <WOKMake_InputFile.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_AdmFile.hxx>
+
+#ifndef WNT
+# define FASTCALL
+#else
+# define FASTCALL __fastcall
+#endif // WNT
+
+Handle(WOKBuilder_Library) FASTCALL _get_unit_library(Handle(WOKernel_DevUnit)&,
+ Handle(TCollection_HAsciiString)&,
+ Handle(TCollection_HAsciiString)&,
+ const WOKUtils_Param&,
+ Standard_Boolean = Standard_False);
+
+//=======================================================================
+//function : WOKStep_EXELink
+//purpose :
+//=======================================================================
+WOKStep_EXELink::WOKStep_EXELink(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aUnit,
+ const Handle(TCollection_HAsciiString)& aCode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_WNTLink(abp, aUnit, aCode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : ComputeTool
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_WNTCollector) WOKStep_EXELink::ComputeTool()
+{
+ Handle(WOKBuilder_EXELinker) retVal = new WOKBuilder_EXELinker(new TCollection_HAsciiString("LINK"), Unit()->Params());
+ return retVal;
+}
+
+//=======================================================================
+//function : ComputeObjectList
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_HSequenceOfObjectFile) WOKStep_EXELink::ComputeObjectList(const Handle(WOKMake_HSequenceOfInputFile)& anInput)
+{
+ Handle(WOKBuilder_ObjectFile) anObj;
+ Handle(WOKBuilder_HSequenceOfObjectFile) retVal = new WOKBuilder_HSequenceOfObjectFile;
+
+ for(int i = 1; i <= anInput->Length(); ++i)
+ {
+ anObj = Handle(WOKBuilder_ObjectFile)::DownCast(anInput->Value(i)->BuilderEntity());
+ if(!anObj.IsNull())retVal->Append(anObj);
+ }
+
+ return retVal;
+}
+
+//=======================================================================
+//function : ComputeLibraryList
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_HSequenceOfLibrary) WOKStep_EXELink::ComputeLibraryList(const Handle(WOKMake_HSequenceOfInputFile)& anInput)
+{
+ Handle(WOKBuilder_Library) aLib;
+ Handle(WOKBuilder_HSequenceOfLibrary) retVal = new WOKBuilder_HSequenceOfLibrary;
+
+ for(int i = 1; i <= anInput->Length(); ++i)
+ {
+ aLib = Handle(WOKBuilder_Library):: DownCast(anInput->Value(i)-> BuilderEntity());
+ if(!aLib.IsNull())retVal->Append(aLib);
+ }
+ return retVal;
+}
--- /dev/null
+-- File: WOKStep_EngDatFiles.cdl
+-- Created: Mon Jul 29 17:14:58 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+class EngDatFiles from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfStepOption from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable EngDatFiles from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end EngDatFiles;
--- /dev/null
+// File: WOKStep_EngDatFiles.cxx
+// Created: Mon Jul 29 17:26:17 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Extension.hxx>
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+
+#include <WOKBuilder_Miscellaneous.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_Command.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_HSequenceOfInputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_EngDatFiles.ixx>
+
+
+//=======================================================================
+//function : WOKStep_EngDatFiles
+//purpose :
+//=======================================================================
+ WOKStep_EngDatFiles::WOKStep_EngDatFiles(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_EngDatFiles::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_EngDatFiles::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_EngDatFiles::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("msentity", infile->ID()->Token(":",2)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ return Standard_True;
+ }
+ }
+ else
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_DATFile: result = new WOKBuilder_Miscellaneous(apath); break;
+ default:
+ return Standard_False;
+ }
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_EngDatFiles::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(TCollection_HAsciiString) astr;
+ static Handle(TCollection_HAsciiString) derivtype = new TCollection_HAsciiString("derivated");
+ static Handle(TCollection_HAsciiString) engdattype = new TCollection_HAsciiString("engdatfile");
+ Standard_Integer i;
+
+ Handle(WOKBuilder_Command) acmd = new WOKBuilder_Command(new TCollection_HAsciiString("COMMAND"),
+ Unit()->Params());
+ acmd->SetShell(Shell());
+
+ if(!Shell()->IsLaunched()) Shell()->Launch();
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKBuilder_Miscellaneous) adatfile;
+ Handle(WOKMake_InputFile) infile = execlist->Value(i), indatfile;
+ Handle(WOKBuilder_Entity) anent = infile->BuilderEntity();
+
+ if(anent->IsKind(STANDARD_TYPE(WOKBuilder_MSEntity)))
+ {
+ Handle(WOKBuilder_MSEntity) amsent = Handle(WOKBuilder_MSEntity)::DownCast(anent);
+ Handle(WOKernel_File) afile;
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(amsent->Name());
+
+ if(!aunit.IsNull())
+ {
+ if(WOKernel_IsInterface(aunit))
+ {
+ astr = new TCollection_HAsciiString(aunit->Name());
+ astr->AssignCat("_ExportedMethods.dat");
+
+ afile = Locator()->Locate(aunit->Name(), derivtype, astr);
+
+ if(afile.IsNull())
+ {
+ ErrorMsg << "WOKStep_EngDatFiles::Execute"
+ << "Unable to locate file : " << astr << " in " << aunit->Name() << endm;
+ SetFailed();
+ }
+ else
+ {
+ adatfile = new WOKBuilder_Miscellaneous(afile->Path());
+ indatfile = new WOKMake_InputFile(afile->LocatorName(),
+ afile, adatfile, afile->Path());
+ indatfile->SetDirectFlag(Standard_False);
+ indatfile->SetLocateFlag(Standard_True);
+ indatfile->SetPhysicFlag(Standard_True);
+ }
+ }
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_EngDatFiles::Execute"
+ << "Could not locate interface : " << amsent->Name() << endm;
+ SetFailed();
+ }
+ }
+ else
+ {
+ if(anent->IsKind(STANDARD_TYPE(WOKBuilder_Miscellaneous)) && anent->Path()->Extension() == WOKUtils_DATFile)
+ {
+ adatfile = Handle(WOKBuilder_Miscellaneous)::DownCast(anent);
+ }
+ }
+
+ if(!adatfile.IsNull())
+ {
+ Handle(WOKernel_File) afile;
+
+ astr = new TCollection_HAsciiString(Unit()->Name());
+ astr->AssignCat("-");
+ astr->AssignCat(adatfile->Path()->FileName());
+
+ afile = new WOKernel_File(astr, Unit(), Unit()->GetFileType(engdattype));
+ afile->GetPath();
+
+ InfoMsg << "WOKStep_EngDatFiles::Execute"
+ << "Copy of : " << adatfile->Path()->Name() << " to " << afile->Path()->Name() << endm;
+
+ switch(acmd->Copy(adatfile->Path(), afile->Path()))
+ {
+ case WOKBuilder_Success:
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(afile->LocatorName(), afile,
+ new WOKBuilder_Miscellaneous(afile->Path()),
+ afile->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ AddExecDepItem(infile, outfile, Standard_True);
+
+ if(!indatfile.IsNull())
+ {
+ AddExecDepItem(indatfile, outfile, Standard_True);
+ }
+ }
+ break;
+ case WOKBuilder_Failed:
+ case WOKBuilder_Unbuilt:
+ ErrorMsg << "WOKStep_EngDatFiles::Execute"
+ << "Copy Failed" << endm;
+ SetFailed();
+ break;
+ }
+ }
+ }
+ if(Status() != WOKMake_Failed)
+ {
+ SetSucceeded();
+ }
+ return;
+}
--- /dev/null
+-- File: WOKStep_EngLDFile.cdl
+-- Created: Fri Feb 28 21:36:24 1997
+-- Author: Jean GAUTIER
+-- <jga@hourax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+
+class EngLDFile from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfStepOption from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable EngLDFile from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end EngLDFile;
--- /dev/null
+// File: WOKStep_EngLDFile.cxx
+// Created: Fri Feb 28 21:37:37 1997
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <fstream.h>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+#include <WOKTools_IndexedMapOfHAsciiString.hxx>
+
+#include <WOKUtils_Extension.hxx>
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_Session.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_Parcel.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKBuilder_Miscellaneous.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_HSequenceOfInputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_EngLDFile.ixx>
+
+
+//=======================================================================
+//function : WOKStep_EngLDFile
+//purpose :
+//=======================================================================
+ WOKStep_EngLDFile::WOKStep_EngLDFile(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_EngLDFile::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_EngLDFile::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_EngLDFile::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull()) {
+ apath = infile->File()->Path();
+ if (apath->Extension() == WOKUtils_DSOFile) {
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_EngLDFile::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+
+ Handle(TCollection_HAsciiString) ldname = new TCollection_HAsciiString(Unit()->Name());
+
+ ldname->AssignCat(".ld");
+
+ Handle(WOKernel_File) ldfile = new WOKernel_File(ldname, Unit(), Unit()->GetFileType("library"));
+
+ ldfile->GetPath();
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(ldfile->LocatorName(), ldfile,
+ new WOKBuilder_Miscellaneous(ldfile->Path()),ldfile->Path());
+
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetMember();
+ outfile->SetProduction();
+ Standard_Integer i;
+ for (i=1; i<=execlist->Length(); i++) {
+ const Handle(WOKMake_InputFile)& infile = execlist->Value(i);
+
+ if(!infile->File().IsNull()) {
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+
+ ofstream astream(ldfile->Path()->Name()->ToCString(), ios::out);
+
+ if(!astream.good())
+ {
+ ErrorMsg << "WOKStep_EngLDFile::Execute"
+ << "Could not open " << ldfile->Path()->Name()->ToCString() << " for writing" << endm;
+ SetFailed();
+ return;
+ }
+
+ Handle(TCollection_HAsciiString) apref = Unit()->Params().Eval("%ENV_EngineLoadPath");
+
+ if(!apref.IsNull())
+ {
+ if ( !apref->IsEmpty()) {
+#ifndef WNT
+ astream << apref->ToCString() << ":";
+#else
+ astream << apref->ToCString() << ";";
+#endif
+ }
+ }
+
+ WOKTools_IndexedMapOfHAsciiString amap;
+
+ // recuperation des repertoires dans l'ordre de visibilite
+
+ Handle(WOKernel_Session) theSession = Unit()->Session();
+ Handle(TCollection_HAsciiString) thewb = Unit()->Nesting();
+ Handle(WOKernel_Workbench) theworkbench = theSession->GetWorkbench(thewb);
+ theworkbench->Open();
+ Handle(TColStd_HSequenceOfHAsciiString) thevisib = theworkbench->Visibility();
+ for (i=1; i <= thevisib->Length(); i++) {
+ Handle(WOKernel_UnitNesting) anest = theSession->GetUnitNesting(thevisib->Value(i));
+ if (!anest.IsNull()) {
+ anest->Open();
+ Handle(TCollection_HAsciiString) adir = anest->Params().Eval("WOKEntity_libdir");
+ if (!adir.IsNull()) {
+ if(!adir->IsEmpty()) {
+#ifndef WNT
+ astream << ":" << adir->ToCString();
+#else
+ astream << ";" << adir->ToCString();
+#endif
+ }
+ }
+ }
+ }
+ astream << endl;
+
+ apref = Unit()->Params().Eval("%ENV_EngineStarterVersion");
+
+ if(!apref.IsNull())
+ {
+ astream << apref->ToCString() << endl;
+ }
+
+
+ astream.close();
+
+ SetSucceeded();
+ return;
+}
--- /dev/null
+-- File: WOKStep_EngLinkList.cdl
+-- Created: Thu Aug 1 18:44:07 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+class EngLinkList from WOKStep
+inherits LinkList from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable EngLinkList from WOKStep;
+
+ ComputeDependency(me; code : HAsciiString from TCollection; adirectlist : HSequenceOfHAsciiString from TColStd)
+ returns HSequenceOfHAsciiString from TColStd is redefined protected;
+
+ ComputeInterface(me:mutable; aunit : DevUnit from WOKernel; infile : InputFile from WOKMake)
+ is virtual private;
+
+ ComputeSchema(me:mutable; aunit : DevUnit from WOKernel; infile : InputFile from WOKMake)
+ is virtual private;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end EngLinkList;
--- /dev/null
+// File: WOKStep_EngLinkList.cxx
+// Created: Fri Aug 2 10:07:09 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <TCollection_HAsciiString.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+#include <WOKTools_MapIteratorOfMapOfHAsciiString.hxx>
+
+#include <WOKUtils_Extension.hxx>
+#include <WOKUtils_Path.hxx>
+
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_UnitGraph.hxx>
+
+#include <WOKBuilder_Entity.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_SharedLibrary.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKStep_EngLinkList.ixx>
+
+
+//=======================================================================
+//function : WOKStep_EngLinList
+//purpose :
+//=======================================================================
+WOKStep_EngLinkList::WOKStep_EngLinkList(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_LinkList(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//function : ComputeDependency
+//purpose :
+//=======================================================================
+Handle(TColStd_HSequenceOfHAsciiString) WOKStep_EngLinkList::ComputeDependency(const Handle(TCollection_HAsciiString)& acode,
+ const Handle(TColStd_HSequenceOfHAsciiString)& directlist) const
+{
+ return WOKernel_DevUnit::ImplementationDep(UnitGraph(), acode, directlist);
+}
+
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : ComputeInterface
+//purpose :
+//=======================================================================
+void WOKStep_EngLinkList::ComputeInterface(const Handle(WOKernel_DevUnit)& aunit, const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKernel_File) objfile;
+ Handle(WOKMake_OutputFile) outfile;
+ Handle(TCollection_HAsciiString) astr;
+ static Handle(TCollection_HAsciiString) objtype = new TCollection_HAsciiString("object");
+
+ astr = new TCollection_HAsciiString(aunit->Name());
+#ifndef WNT
+ astr->AssignCat(".o");
+#else
+ astr->AssignCat(".obj");
+#endif
+
+ objfile = Locator()->Locate(aunit->Name(), objtype, astr);
+
+ if(objfile.IsNull())
+ {
+ ErrorMsg << "WOKStep_EngLinkList::Execute"
+ << "Could not locate object file for interface : " << aunit->Name() << endm;
+ SetFailed();
+ }
+ else
+ {
+ outfile = new WOKMake_OutputFile(objfile->LocatorName(), objfile,
+ new WOKBuilder_ObjectFile(objfile->Path()), objfile->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetReference();
+
+ AddExecDepItem(infile,outfile, Standard_True);
+ }
+ return;
+}
+
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : ComputeSchema
+//purpose :
+//=======================================================================
+void WOKStep_EngLinkList::ComputeSchema(const Handle(WOKernel_DevUnit)& aunit, const Handle(WOKMake_InputFile)& infile)
+{
+ return;
+}
+
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_EngLinkList::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(TColStd_HSequenceOfHAsciiString) getsupplist = new TColStd_HSequenceOfHAsciiString;
+
+ WOKTools_MapOfHAsciiString amap;
+ Handle(WOKBuilder_Library) alib;
+ Handle(WOKernel_DevUnit) aunit;
+ Handle(WOKMake_InputFile) inengine;
+ Standard_Integer i;
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_OutputFile) outfile;
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKBuilder_Entity) anent = infile->BuilderEntity();
+
+ if(anent->IsKind(STANDARD_TYPE(WOKBuilder_Library)) || anent->IsKind(STANDARD_TYPE(WOKBuilder_ObjectFile)))
+ {
+ outfile = new WOKMake_OutputFile(infile);
+ outfile->SetReference();
+ AddExecDepItem(infile,outfile, Standard_True);
+ }
+ else
+ {
+ if(anent->IsKind(STANDARD_TYPE(WOKBuilder_MSEntity)))
+ {
+ Handle(WOKBuilder_MSEntity) amsent = Handle(WOKBuilder_MSEntity)::DownCast(anent);
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(amsent->Name());
+
+ if(!aunit.IsNull())
+ {
+ if(WOKernel_IsInterface(aunit))
+ {
+ ComputeInterface(aunit, infile);
+
+ getsupplist->Append(aunit->Name());
+ // ajouter l'ud
+ }
+ else if(WOKernel_IsEngine(aunit))
+ {
+ inengine = infile;
+ }
+ else if(WOKernel_IsSchema(aunit))
+ {
+ ComputeSchema(aunit,infile);
+ //getsupplist->Append(aunit->Name());
+ }
+
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_EngLinkList::Execute"
+ << "Could not locate interface : " << amsent->Name() << endm;
+ SetFailed();
+ }
+ }
+ }
+ }
+
+ if(inengine.IsNull())
+ {
+ ErrorMsg << "WOKStep_EngLinkList::Execute"
+ << "Could determine current engine in InputList" << endm;
+ SetFailed();
+ }
+ else
+ {
+ for(i=1; i<=getsupplist->Length(); i++)
+ {
+ amap.Add(getsupplist->Value(i));
+ }
+
+ Handle(TColStd_HSequenceOfHAsciiString) suppliers = ComputeDependency(Unit()->Name(), getsupplist);
+
+
+ if (suppliers.IsNull())
+ {
+ SetFailed();
+ return;
+ }
+
+ Handle(WOKMake_OutputFile) outfile;
+
+ for(i=suppliers->Length()-1; i>=1; i--)
+ {
+
+ ComputeExternals(suppliers->Value(i));
+
+ Standard_Boolean use_lib = Standard_True;
+
+ aunit = Locator()->LocateDevUnit(suppliers->Value(i));
+
+ if(WOKernel_IsInterface(aunit))
+ {
+ if(amap.Contains(aunit->Name()))
+ {
+ // L'interface est utilisee en tant que stub serveur
+ use_lib = Standard_False;
+ }
+ }
+
+ if(use_lib)
+ {
+ //
+ AddUnitContribution(inengine, aunit->Name());
+ }
+
+ }
+ }
+ if(!CheckStatus("Execute")) SetSucceeded();
+ return;
+}
+
+
+
+
+
+
--- /dev/null
+-- File: WOKStep_EngineExtract.cdl
+-- Created: Thu Jun 27 17:22:16 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class EngineExtract from WOKStep
+inherits Extract from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable EngineExtract from WOKStep;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ OutOfDateEntities(me:mutable)
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+end EngineExtract;
--- /dev/null
+// File: WOKStep_EngineExtract.cxx
+// Created: Wed Jan 3 18:23:04 1996
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKBuilder_MSEngineExtractor.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+
+#include <WOKernel_File.hxx>
+
+#include <WOKMake_InputFile.hxx>
+
+#include <WOKStep_EngineExtract.ixx>
+
+
+//=======================================================================
+//function : WOKStep_HeaderExtract
+//purpose :
+//=======================================================================
+WOKStep_EngineExtract::WOKStep_EngineExtract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Extract(abp,aunit, acode, checked, hidden)
+{
+ SetExtractor(new WOKBuilder_MSEngineExtractor(Unit()->Params()));
+}
+
+
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_EngineExtract::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("msentity", infile->ID()->Token(":",2)->ToCString()) &&
+ !strcmp(Unit()->Name()->ToCString(), infile->ID()->Token(":",3)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_EngineExtract::OutOfDateEntities()
+{
+ return ForceBuild();
+}
+
+
--- /dev/null
+-- File: WOKStep_ExecLink.cdl
+-- Created: Thu Aug 1 18:47:37 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+class ExecLink from WOKStep
+inherits Link from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection
+
+is
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ExecLink from WOKStep;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+
+end ExecLink;
--- /dev/null
+// File: WOKStep_ExecLink.cxx
+// Created: Fri Aug 2 10:08:23 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+
+#include <WOKernel_File.hxx>
+
+#include <WOKBuilder_ExecutableLinker.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_Library.hxx>
+#include <WOKBuilder_Executable.hxx>
+#include <WOKBuilder_HSequenceOfObjectFile.hxx>
+#include <WOKBuilder_HSequenceOfLibrary.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+
+#include <WOKStep_ExecLink.ixx>
+
+//=======================================================================
+//function : WOKStep_ExecLink
+//purpose :
+//=======================================================================
+WOKStep_ExecLink::WOKStep_ExecLink(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_Link(abp,aunit,acode,checked,hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_ExecLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i,j;
+ Handle(WOKBuilder_Library) alib;
+ Handle(TCollection_HAsciiString) libname;
+ Handle(WOKernel_File) libpath;
+ Handle(WOKUtils_Path) apath;
+
+ mylinker = new WOKBuilder_ExecutableLinker(new TCollection_HAsciiString("LDEXE"),
+ Unit()->Params());
+
+ Handle(TColStd_HSequenceOfHAsciiString) externals = new TColStd_HSequenceOfHAsciiString;
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("external", infile->ID()->Token(":", 2)->ToCString()))
+ {
+ Handle(TCollection_HAsciiString) astr = new TCollection_HAsciiString("%");
+ astr->AssignCat(infile->ID()->Token(":", 3));
+
+ externals->Append(astr);
+ }
+ }
+ }
+
+ if(SubCode().IsNull())
+ {
+ mytarget = Unit()->Name();
+ }
+ else
+ {
+ mytarget = SubCode();
+ }
+
+ myexternals = externals;
+ myobjects = ComputeObjectList(execlist);
+ mylibraries = ComputeLibraryList(execlist);
+ mylibpathes = ComputeLibrarySearchList(execlist);
+ mydbdirs = ComputeDatabaseDirectories();
+
+ if (Status()==WOKMake_Failed)
+ return;
+
+ Handle(WOKMake_HSequenceOfOutputFile) outfiles = new WOKMake_HSequenceOfOutputFile;
+ WOKMake_Status status;
+
+ status = ExecuteLink(outfiles);
+
+ switch(status)
+ {
+ case WOKMake_Success:
+ if(!outfiles.IsNull())
+ {
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ for(j=1; j<=outfiles->Length(); j++)
+ {
+ AddExecDepItem(execlist->Value(i), outfiles->Value(j), Standard_True);
+ }
+ }
+ }
+ break;
+ case WOKMake_Uptodate:
+ case WOKMake_Incomplete:
+ case WOKMake_Failed:
+ case WOKMake_Unprocessed:
+ break;
+ }
+ SetStatus(status);
+ return;
+}
--- /dev/null
+-- File: WOKStep_ExecutableSource.cdl
+-- Created: Thu Jun 27 17:17:00 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class ExecutableSource from WOKStep
+inherits CDLUnitSource from WOKStep
+
+ ---Purpose: Computes CDLUnitSource File List.
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ File from WOKernel,
+ HSequenceOfFile from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ExecutableSource from WOKStep;
+
+ ReadUnitDescr(me:mutable; unitcdl : InputFile from WOKMake) is redefined protected;
+ ---Purpose: Read Unit.cdl file to obtain CDL files list
+
+end ExecutableSource;
+
+
--- /dev/null
+// File: WOKStep_ExecutableSource.cxx
+// Created: Tue Feb 6 15:52:11 1996
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKBuilder_CDLFile.hxx>
+#include <WOKBuilder_MSchema.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_MSTool.hxx>
+
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_File.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfInputFile.hxx>
+
+#include <WOKStep_ExecutableSource.ixx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_ExecutableSource
+//purpose :
+//=======================================================================
+WOKStep_ExecutableSource::WOKStep_ExecutableSource(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_CDLUnitSource(abp,aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : ReadUnitDescr
+//purpose :
+//=======================================================================
+void WOKStep_ExecutableSource::ReadUnitDescr(const Handle(WOKMake_InputFile)& EXECDL)
+{
+ Standard_Integer i;
+ Handle(WOKBuilder_MSchema) ameta = WOKBuilder_MSTool::GetMSchema();
+ Handle(TColStd_HSequenceOfHAsciiString) aseq;
+ Handle(WOKernel_File) gefile, thefile, NULLFILE;
+
+ WOKStep_CDLUnitSource::ReadUnitDescr(EXECDL);
+
+ switch(Status())
+ {
+ case WOKMake_Failed:
+ return;
+ default:
+ break;
+ }
+
+ Handle(TCollection_HAsciiString) msentity = new TCollection_HAsciiString("msentity");
+
+ aseq = ameta->ExecutableParts(Unit()->Name());
+
+ for(i=1; i<=aseq->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(TCollection_HAsciiString) msid = WOKernel_File::FileLocatorName(Unit()->Name(), msentity, aseq->Value(i));
+
+ Handle(WOKBuilder_Specification) cdlent = Handle(WOKBuilder_Specification)::DownCast(EXECDL->BuilderEntity());
+ Handle(WOKBuilder_MSEntity) exeent = new WOKBuilder_MSEntity(cdlent, aseq->Value(i));
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(msid,
+ NULLFILE,
+ cdlent, cdlent->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ outfile->SetPhysicFlag(Standard_False);
+ AddExecDepItem(EXECDL, outfile, Standard_True);
+ }
+}
+
--- /dev/null
+-- File: WOKStep_Extract.cdl
+-- Created: Thu Jun 27 17:19:04 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+deferred class Extract from WOKStep
+inherits MSStep from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ MSExtractor from WOKBuilder,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Initialize(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard);
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ SetExtractor(me:mutable; anextractor : MSExtractor from WOKBuilder);
+ Extractor(me) returns MSExtractor from WOKBuilder;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+fields
+
+ myextractor : MSExtractor from WOKBuilder;
+
+end Extract;
--- /dev/null
+// File: WOKStep_Extract.cxx
+// Created: Tue Aug 29 21:40:59 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <WOKStep_Extract.ixx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKBuilder_Entity.hxx>
+#include <WOKBuilder_Include.hxx>
+#include <WOKBuilder_Compilable.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_MSExtractorIterator.hxx>
+#include <WOKBuilder_MSExtractor.hxx>
+#include <WOKBuilder_MSchema.hxx>
+#include <WOKBuilder_MSActionID.hxx>
+#include <WOKBuilder_MSAction.hxx>
+#include <WOKBuilder_Command.hxx>
+
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+
+
+#include <WOKMake_OutputFile.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+
+//=======================================================================
+//function : WOKStep_Extract
+//purpose :
+//=======================================================================
+WOKStep_Extract::WOKStep_Extract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_MSStep(abp,aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Extract::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)DBADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Extract::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)DBTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : SetExtractor
+//purpose :
+//=======================================================================
+void WOKStep_Extract::SetExtractor(const Handle(WOKBuilder_MSExtractor)& anextractor)
+{
+ myextractor = anextractor;
+}
+
+//=======================================================================
+//function : Extractor
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_MSExtractor) WOKStep_Extract::Extractor() const
+{
+ return myextractor;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_Extract::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("msentity", infile->ID()->Token(":",2)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_Extract::Execute(const Handle(WOKMake_HSequenceOfInputFile)& tobuild)
+{
+ Standard_Integer i,j;
+
+ // Used Types
+ Handle(WOKernel_FileType) sourcetype = Unit()->GetFileType("source");
+ Handle(WOKernel_FileType) privincludetype = Unit()->GetFileType("privinclude");
+ Handle(WOKernel_FileType) pubincludetype = Unit()->GetFileType("pubinclude");
+ Handle(WOKernel_FileType) derivatedtype = Unit()->GetFileType("derivated");
+ Handle(WOKernel_FileType) englispfiletype = Unit()->GetFileType("englisp");
+
+ Handle(WOKBuilder_Command) acmd = new WOKBuilder_Command(new TCollection_HAsciiString("COMMAND"), Unit()->Params());
+ Handle(WOKUtils_Shell) ashell = Shell();
+
+ ashell->Lock();
+ acmd->SetShell(ashell);
+
+ Handle(WOKernel_File) outfile, basefile;
+ Extractor()->Load();
+ Extractor()->SetOutputDir(OutputDir());
+
+ WOKBuilder_MSExtractorIterator anit(WOKBuilder_MSTool::GetMSchema(), Extractor());
+
+
+ for(j=1; j<=tobuild->Length(); j++)
+ {
+
+ Handle(WOKBuilder_MSEntity) entity = Handle(WOKBuilder_MSEntity)::DownCast(tobuild->Value(j)->BuilderEntity());
+ WOKBuilder_MSActionID anid(entity->Name(), Extractor()->ExtractorID());
+
+ switch(anit.Execute(entity))
+ {
+ case WOKBuilder_Success:
+ {
+ WOK_TRACE {
+ if(VerboseMsg("WOK_EXTRACT").IsSet())
+ {
+ VerboseMsg << "WOKStep_Extract::Execute"
+ << entity->Name() << " produces : " << endm;
+ for(i=1; i<=anit.Produces()->Length(); i++)
+ {
+ VerboseMsg << "WOKStep_Extract::Execute"
+ << "\t\t" << anit.Produces()->Value(i)->Path()->Name() << endm;
+ }
+ }
+ }
+
+ Handle(WOKBuilder_MSAction) anaction = Extractor()->MSchema()->GetAction(anid);
+ Handle(WOKBuilder_Entity) outent;
+
+ if (!anit.Produces()->Length())
+ Extractor()->MSchema()->ChangeAddAction(anid, Handle(WOKBuilder_Specification)());
+
+ for(i=1; i<=anit.Produces()->Length(); i++)
+ {
+ Standard_Boolean istemplate = Standard_False;
+
+ outent = anit.Produces()->Value(i);
+ switch(outent->Path()->Extension())
+ {
+ case WOKUtils_HXXFile:
+ // a .hxx file is a public include
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), pubincludetype);
+ break;
+ case WOKUtils_IXXFile:
+ case WOKUtils_JXXFile:
+ case WOKUtils_DDLFile:
+ // Private includes
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), privincludetype);
+ break;
+ case WOKUtils_CXXFile:
+ // Devivated Cxx file
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), derivatedtype);
+ break;
+ case WOKUtils_DATFile:
+ // Derivated datafile
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), derivatedtype);
+ break;
+ case WOKUtils_LispFile:
+ // Engine Lisp File
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), englispfiletype);
+ break;
+ case WOKUtils_TemplateFile:
+ outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), sourcetype);
+ istemplate = Standard_True;
+ break;
+ }
+
+ outfile->GetPath();
+ basefile = Locator()->Locate(Unit()->Name(), outfile->TypeName(), outfile->Name());
+
+ WOKBuilder_BuildStatus astatus = WOKBuilder_Unbuilt;
+
+ if(basefile.IsNull())
+ {
+ // pas encore de Fichier : Simply Move
+ astatus = acmd->Move(outent->Path(), outfile->Path());
+ }
+ else
+ {
+ if(!outent->Path()->IsSameFile(basefile->Path()))
+ {
+ astatus = acmd->Move(outent->Path(), outfile->Path());
+ }
+ }
+
+ Handle(WOKMake_OutputFile) out;
+
+ switch(astatus)
+ {
+ case WOKBuilder_Success:
+ Extractor()->MSchema()->ChangeAddAction(anid, Handle(WOKBuilder_Specification)());
+
+ outent->SetPath(outfile->Path());
+ out = new WOKMake_OutputFile(outfile->LocatorName(), outfile, outent, outfile->Path());
+ out->SetLocateFlag(Standard_True);
+ out->SetProduction();
+ if(!istemplate) AddExecDepItem(tobuild->Value(j), out, Standard_True);
+
+ InfoMsg << "WOKStep_Extract::Execute" << "File : " << outfile->Path()->Name() << " is modified" << endm;
+ break;
+ case WOKBuilder_Unbuilt:
+ WOK_TRACE {
+ VerboseMsg("WOK_EXTRACT") << "WOKStep_Extract::Execute"
+ << "File : " << outfile->Path()->Name() << " is unchanged" << endm;
+ }
+ Extractor()->MSchema()->ChangeAddAction(anid, Handle(WOKBuilder_Specification)());
+
+ outent->Path()->RemoveFile();
+ outent->SetPath(basefile->Path());
+ out = new WOKMake_OutputFile(basefile->LocatorName(), basefile, outent, basefile->Path());
+ out->SetLocateFlag(Standard_True);
+ out->SetProduction();
+ if(!istemplate) AddExecDepItem(tobuild->Value(j), out, Standard_True);
+ break;
+ case WOKBuilder_Failed:
+ Extractor()->MSchema()->ChangeActionToFailed(anid);
+
+ SetFailed();
+ ErrorMsg << "WOKStep_Extract::Execute" << "Failed : " << outfile->Name() << endm;
+ break;
+ }
+ }
+ }
+ break;
+ case WOKBuilder_Failed:
+ Extractor()->MSchema()->ChangeActionToFailed(anid);
+
+ ErrorMsg << "WOKStep_Extract::Execute" << "Failed : " << entity->Name() << endm;
+ break;
+ }
+ }
+
+ ashell->UnLock();
+
+ if(Status() == WOKMake_Unprocessed) SetSucceeded();
+ return;
+}
--- /dev/null
+-- File: WOKStep_ExtractExecList.cdl
+-- Created: Wed Aug 28 18:22:45 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+class ExtractExecList from WOKStep
+inherits MetaStep from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+ Create( abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ExtractExecList from WOKStep;
+
+ HandleInputFile(me:mutable; anitem : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ ---Purpose: Executes underlying steps
+ -- Computes output files
+ is redefined private;
+
+end ExtractExecList;
--- /dev/null
+// File: WOKStep_ExtractExecList.cxx
+// Created: Wed Aug 28 18:24:06 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_MSchema.hxx>
+#include <WOKBuilder_MSTool.hxx>
+
+#ifndef WNT
+# include <WOKBuilder_SharedLibrary.hxx>
+#else
+# include <WOKNT_WNT_BREAK.hxx>
+# include <WOKBuilder_ImportLibrary.hxx>
+#endif // WNT
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKStep_ExtractExecList.ixx>
+
+//=======================================================================
+//function : WOKStep_ExtractExecList
+//purpose :
+//=======================================================================
+WOKStep_ExtractExecList::WOKStep_ExtractExecList(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKMake_MetaStep(abp,aunit, acode, checked, hidden)
+{
+
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ExtractExecList::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)ADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ExtractExecList::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)TMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_ExtractExecList::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ if(infile->IsStepID())
+ return Standard_True;
+
+ if(!infile.IsNull())
+ {
+ if(!strcmp("msentity", infile->ID()->Token(":",2)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_ExtractExecList::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i;
+ Handle(WOKBuilder_MSchema) ameta = WOKBuilder_MSTool::GetMSchema();
+ Handle(TColStd_HSequenceOfHAsciiString) aseq;
+
+ if(SubCode().IsNull())
+ {
+ Standard_Boolean ok = Standard_True;
+ // partie MetaStep
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKBuilder_MSEntity) bent = Handle(WOKBuilder_MSEntity)::DownCast(infile->BuilderEntity());
+
+ if(!bent.IsNull())
+ {
+ Handle(TCollection_HAsciiString) part = bent->Name();
+
+ Handle(TCollection_HAsciiString) id = WOKMake_Step::StepOutputID(Unit()->Name(),
+ Code(),
+ part);
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(id, Handle(WOKernel_File)(),
+ Handle(WOKBuilder_Entity)(), Handle(WOKUtils_Path)());
+ outfile->SetProduction();
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetPhysicFlag(Standard_False);
+ outfile->SetStepID(Standard_True);
+
+ Handle(WOKMake_Step) astep = BuildProcess()->GetAndAddStep(Unit(), Code(), bent->Name());
+
+ astep->DoExecute();
+ astep->SetTargets(Targets());
+ astep->SetOptions(Options());
+
+ InfoMsg << "WOKStep_ExtractExecList::Execute"
+ << "Extracting Executable list for part : " << part << endm;
+
+ switch(astep->Make())
+ {
+ case WOKMake_Uptodate:
+ InfoMsg << "WOKMake_MetaStep::Execute"
+ << "========> " << astep->SubCode() << " is uptodate" << endm;
+ break;
+ case WOKMake_Success:
+ InfoMsg << "WOKMake_MetaStep::Execute"
+ << "========> " << astep->SubCode() << " succeeded" << endm;
+ break;
+ case WOKMake_Incomplete:
+ WarningMsg << "WOKMake_MetaStep::Execute"
+ << "========> " << astep->SubCode() << " is incomplete" << endm;
+ break;
+ case WOKMake_Failed:
+ ErrorMsg << "WOKMake_MetaStep::Execute"
+ << "========> " << astep->SubCode() << " failed" << endm;
+ ok = Standard_False;
+ break;
+ case WOKMake_Unprocessed:
+ WarningMsg << "WOKMake_MetaStep::Execute"
+ << "========> " << astep->SubCode() << " is still unprocessed" << endm;
+ ok=Standard_False;
+ break;
+ }
+
+ AddExecDepItem(infile,outfile, Standard_True);
+ }
+ }
+ if(ok) SetSucceeded();
+ else SetFailed();
+ }
+ else
+ {
+ // SubStep (Output Files)
+ Standard_Boolean missings = Standard_False;
+ Handle(TCollection_HAsciiString) sourcetype = new TCollection_HAsciiString("source");
+ Handle(TCollection_HAsciiString) stadmfiletype = new TCollection_HAsciiString("stadmfile");
+
+ for(i=1;i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKBuilder_MSEntity) bent = Handle(WOKBuilder_MSEntity)::DownCast(infile->BuilderEntity());
+ if(!bent.IsNull())
+ {
+ Handle(TCollection_HAsciiString) part = bent->Name();
+
+ if(part->IsSameString(SubCode()))
+ {
+ Handle(TColStd_HSequenceOfHAsciiString) files = ameta->ExecutableFiles(Unit()->Name(), SubCode());
+ Handle(WOKernel_File) thefile;
+ Standard_Integer j;
+
+ for(j=1; j<=files->Length(); j++)
+ {
+ thefile = Locator()->Locate(Unit()->Name(), sourcetype, files->Value(j));
+
+ if(!thefile.IsNull())
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(thefile->LocatorName(),
+ thefile,
+ Handle(WOKBuilder_Entity)(), thefile->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ else
+ {
+ WarningMsg << "WOKStep_ExtractExecList::Execute"
+ << "Missing file : " << files->Value(j) << " in unit : " << Unit()->Name() << endm;
+ missings = Standard_True;
+ }
+ }
+
+ Handle(TColStd_HSequenceOfHAsciiString) libs = ameta->ExecutableLibraries(Unit()->Name(), SubCode());
+
+ for(j=1; j<=libs->Length(); j++)
+ {
+ Handle(WOKernel_DevUnit) unit = Locator()->LocateDevUnit(libs->Value(j));
+
+ if(unit.IsNull())
+ {
+ WarningMsg << "WOKStep_ExtractExecList::Execute"
+ << "Wrong (or not found) libray uses : " << libs->Value(j) << endm;
+ missings = Standard_True;
+ }
+ else
+ {
+ Handle(WOKernel_File) NULLFILE;
+ Handle(WOKBuilder_Entity) NULLENTITY;
+ Handle(WOKUtils_Path) NULLPATH;
+ Handle(TCollection_HAsciiString) libid = new TCollection_HAsciiString(libs->Value(j));
+
+ libid->AssignCat(":mslibrary:");
+ libid->AssignCat(libs->Value(j));
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(libid, NULLFILE, NULLENTITY, NULLPATH);
+
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetPhysicFlag(Standard_False);
+ outfile->SetReference();
+ outfile->SetExtern();
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+
+ Handle(TColStd_HSequenceOfHAsciiString) externs = ameta->ExecutableExternals(Unit()->Name(), SubCode());
+
+ for(j=1; j<=externs->Length(); j++)
+ {
+ Handle(WOKernel_File) NULLFILE;
+ Handle(WOKBuilder_Entity) NULLENTITY;
+ Handle(WOKUtils_Path) NULLPATH;
+ Handle(TCollection_HAsciiString) externid = new TCollection_HAsciiString(Unit()->Name());
+
+ externid->AssignCat(":external:");
+ externid->AssignCat(externs->Value(j));
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(externid, NULLFILE, NULLENTITY, NULLPATH);
+
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ outfile->SetPhysicFlag(Standard_False);
+ outfile->SetExtern();
+
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+ }
+ }
+ if(missings) SetIncomplete();
+ else SetSucceeded();
+ }
+ return;
+}
--- /dev/null
+-- File: WOKStep_HeaderExtract.cdl
+-- Created: Thu Jun 27 17:19:40 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class HeaderExtract from WOKStep
+inherits Extract from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable HeaderExtract from WOKStep;
+
+ OutOfDateEntities(me:mutable)
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+end HeaderExtract;
--- /dev/null
+// File: WOKStep_HeaderExtract.cxx
+// Created: Tue Aug 29 21:41:04 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKBuilder_MSHeaderExtractor.hxx>
+#include <WOKBuilder_MSActionID.hxx>
+#include <WOKBuilder_MSAction.hxx>
+#include <WOKBuilder_MSchema.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKStep_HeaderExtract.ixx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_HeaderExtract
+//purpose :
+//=======================================================================
+WOKStep_HeaderExtract::WOKStep_HeaderExtract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Extract(abp,aunit, acode, checked, hidden)
+{
+
+ Handle(WOKBuilder_MSHeaderExtractor) anextractor = new WOKBuilder_MSHeaderExtractor(aunit->Params());
+
+ anextractor->SetMSchema(WOKBuilder_MSTool::GetMSchema());
+ SetExtractor(anextractor);
+}
+
+
+//=======================================================================
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_HeaderExtract::OutOfDateEntities()
+{
+ Handle(WOKMake_HSequenceOfInputFile) result = new WOKMake_HSequenceOfInputFile;
+ Standard_Integer i;
+
+ LoadDependencies();
+
+ Handle(WOKBuilder_MSchema) ameta = Extractor()->MSchema();
+
+ for(i=1; i<=myinflow.Extent(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKMake_InputFile) infile = myinflow(i);
+ Handle(WOKBuilder_MSEntity) anent = Handle(WOKBuilder_MSEntity)::DownCast(infile->BuilderEntity());
+
+ if(anent.IsNull())
+ {
+ ErrorMsg << "WOKStep_HeaderExtract::OutOfDateEntities"
+ << infile->ID() << " is not a MS Entity" << endm;
+ SetFailed();
+ return result;
+ }
+
+ WOKBuilder_MSActionID anid(anent->Name(), Extractor()->ExtractorID());
+
+ Handle(WOKBuilder_MSAction) anaction = ameta->GetAction(anid);
+
+ switch(Extractor()->ExtractionStatus(anaction))
+ {
+ case WOKBuilder_OutOfDate:
+ result->Append(infile);
+ break;
+ case WOKBuilder_UpToDate:
+ break;
+ case WOKBuilder_NotDefined:
+ SetFailed();
+ return result;
+ }
+ }
+ return result;
+}
--- /dev/null
+-- File: WOKStep_ImplementationDep.cdl
+-- Created: Thu Jun 27 17:32:13 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class ImplementationDep from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ Path from WOKUtils,
+ MapOfHAsciiString from WOKTools,
+ HAsciiString from TCollection
+
+is
+
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ImplementationDep from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end ImplementationDep;
--- /dev/null
+// File: WOKStep_ImplementationDep.cxx
+// Created: Thu Oct 26 18:36:01 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <fstream.h>
+
+#include <TCollection_HAsciiString.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <OSD_Protection.hxx>
+
+#include <WOKTools_MapOfHAsciiString.hxx>
+#include <WOKTools_MapIteratorOfMapOfHAsciiString.hxx>
+#include <WOKTools_Messages.hxx>
+
+#ifndef WNT
+# include <WOKUnix_FDescr.hxx>
+#endif // WNT
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_AdmFile.hxx>
+
+#include <WOKernel_HSequenceOfFile.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_Session.hxx>
+
+#include <WOKBuilder_MFile.hxx>
+#include <WOKBuilder_Command.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_ImplementationDep.ixx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+#define READBUF_SIZE 1024
+
+//=======================================================================
+//function : WOKStep_ImplementationDep
+//purpose :
+//=======================================================================
+ WOKStep_ImplementationDep::WOKStep_ImplementationDep(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ImplementationDep::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ImplementationDep::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_ImplementationDep::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+ Handle(TCollection_HAsciiString) INTERNLIB = Unit()->Params().Eval("%FILENAME_INTERNLIB");
+
+ if(!infile->File().IsNull())
+ {
+ if(!strcmp(infile->File()->Path()->ExtensionName()->ToCString(), ".In"))
+ {
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ else if(!strcmp(infile->File()->TypeName()->ToCString(), "source") &&
+ !strcmp(infile->File()->Name()->ToCString(), INTERNLIB->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_ImplementationDep::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(TCollection_HAsciiString) INTERNLIB = Unit()->Params().Eval("%FILENAME_INTERNLIB");
+ WOKTools_MapOfHAsciiString inresult;
+ Handle(TColStd_HSequenceOfHAsciiString) internresult;
+ Handle(WOKMake_InputFile) InFile, InternFile;
+ Handle(WOKMake_HSequenceOfInputFile) InFiles = new WOKMake_HSequenceOfInputFile;
+
+ for(Standard_Integer i=1; i<=execlist->Length(); i++)
+ {
+ const Handle(WOKMake_InputFile)& infile = execlist->Value(i);
+
+ if(!strcmp(infile->File()->Path()->ExtensionName()->ToCString(), ".In"))
+ {
+ InFiles->Append(infile);
+ }
+ else if(!strcmp(infile->File()->TypeName()->ToCString(), "source") &&
+ !strcmp(infile->File()->Name()->ToCString(), INTERNLIB->ToCString()))
+ {
+ InternFile = infile;
+ }
+ }
+
+
+ if (InternFile.IsNull()) {
+ // Recherche d'un eventuel INTERNLIB
+ Handle(WOKernel_File) internlib = Locator()->Locate(Unit()->Name(), new TCollection_HAsciiString("source"), INTERNLIB);
+
+ if(!internlib.IsNull())
+ {
+ if(!myinflow.Contains(internlib->LocatorName()))
+ {
+ WarningMsg << "WOKStep_ImplementationDep::Execute"
+ << "Ignoring unlisted (in FILES) located " << INTERNLIB << " file " << endm;
+ }
+ else
+ {
+ InfoMsg << "WOKStep_ImplementationDep::Execute"
+ << "Using " << INTERNLIB << " file for implementation dependance" << endm;
+
+ InternFile = myinflow.FindFromKey(internlib->LocatorName());
+ }
+ }
+ else
+ {
+ Handle(TCollection_HAsciiString) internlocname =
+ WOKernel_File::FileLocatorName(Unit()->Name(),
+ new TCollection_HAsciiString("source"),
+ INTERNLIB);
+
+ if(myinflow.Contains(internlocname))
+ {
+ ErrorMsg << "WOKStep_ImplementationDep::Execute"
+ << "Could not locate listed (in FILES) " << INTERNLIB
+ << " in unit : " << Unit()->Name() << endm;
+ SetFailed();
+ return;
+ }
+ }
+
+ }
+
+
+ // le ImplDep
+ Handle(TCollection_HAsciiString) aname = new TCollection_HAsciiString(Unit()->Name());
+ if(!SubCode().IsNull())
+ {
+ aname->AssignCat("_");
+ aname->AssignCat(SubCode());
+ }
+ aname->AssignCat(".");
+ aname->AssignCat(Unit()->Params().Eval("%FILENAME_IMPLDEP"));
+
+
+ Handle(WOKernel_File) idep = new WOKernel_File(aname, Unit(), Unit()->FileTypeBase()->Type("stadmfile"));
+
+ idep->GetPath();
+
+ Handle(WOKMake_OutputFile) outidep = new WOKMake_OutputFile(idep->LocatorName(), idep,
+ Handle(WOKBuilder_Entity)(), idep->Path());
+ outidep->SetProduction();
+ outidep->SetLocateFlag(Standard_True);
+
+
+ WOKTools_MapOfHAsciiString& knownunits = BuildProcess()->KnownUnits();
+
+ if(InternFile.IsNull() && InFiles->Length())
+ {
+ for(Standard_Integer i=1; i<=InFiles->Length(); i++)
+ {
+ const Handle(WOKMake_InputFile)& InFile = InFiles->Value(i);
+
+ WOKMake_IndexedDataMapOfHAsciiStringOfInputFile inmap;
+
+ WOKMake_InputFile::ReadFile(InFile->File()->Path(), InLocator(), inmap);
+
+ for(Standard_Integer j=1; j<=inmap.Extent(); j++)
+ {
+ const Handle(WOKMake_InputFile)& depfile = inmap(j);
+
+ if(depfile->IsLocateAble() && depfile->IsPhysic() && !depfile->IsStepID())
+ {
+ const Handle(WOKernel_File)& file = depfile->File();
+ const Handle(TCollection_HAsciiString)& uname = Unit()->Session()->GetEntity(file->Nesting())->Name();
+
+ if(!inresult.Contains(uname)) inresult.Add(uname);
+ }
+ }
+ AddExecDepItem(InFile, outidep, Standard_True);
+ }
+
+ WOKTools_MapIteratorOfMapOfHAsciiString anit(inresult);
+
+ ofstream stream(idep->Path()->Name()->ToCString());
+
+ while(anit.More())
+ {
+ stream << anit.Key()->ToCString() << endl;
+ anit.Next();
+ }
+ stream.close();
+
+ }
+ else if(!InternFile.IsNull())
+ {
+ WOKUtils_AdmFile afile(InternFile->File()->Path());
+
+ internresult = afile.Read();
+
+ if(!internresult.IsNull())
+ {
+ ofstream stream(idep->Path()->Name()->ToCString());
+ for(Standard_Integer i=1; i<=internresult->Length(); i++)
+ {
+ stream << internresult->Value(i)->ToCString() << endl;
+ }
+ stream.close();
+ }
+
+ AddExecDepItem(InternFile, outidep, Standard_True);
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_ImplementationDep::Execute"
+ << "Could not find any input to get Implementation dependencies" << endm;
+ SetFailed();
+ return;
+ }
+ SetSucceeded();
+ return;
+}
+
+
+
--- /dev/null
+-- File: WOKStep_ImportLibrary.cdl
+-- Created: Fri Oct 25 16:20:04 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+class ImportLibrary from WOKStep inherits WNTLibrary from WOKStep
+
+ uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection,
+ WNTCollector from WOKBuilder
+
+ is
+
+ Create (
+ abp : BuildProcess from WOKMake;
+ aUnit : DevUnit from WOKernel;
+ aCode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ ) returns mutable ImportLibrary from WOKStep;
+ ---Purpose: creates a class instance
+
+ ComputeTool ( me : mutable )
+ returns mutable WNTCollector from WOKBuilder
+ is redefined static protected;
+ ---Purpose: computes build tool
+
+end ImportLibrary;
--- /dev/null
+#include <WOKStep_ImportLibrary.ixx>
+
+#include <WOKBuilder_ImportLibrarian.hxx>
+
+WOKStep_ImportLibrary :: WOKStep_ImportLibrary (
+ const Handle(WOKMake_BuildProcess)& abp,
+ const Handle( WOKernel_DevUnit )& aUnit,
+ const Handle( TCollection_HAsciiString )& aCode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden
+ ) : WOKStep_WNTLibrary ( abp, aUnit, aCode, checked, hidden ) {
+} // end constructor
+
+Handle( WOKBuilder_WNTCollector ) WOKStep_ImportLibrary :: ComputeTool () {
+
+ return new WOKBuilder_ImportLibrarian (
+ new TCollection_HAsciiString ( "LIB" ), Unit () -> Params ()
+ );
+
+} // end WOKStep_ImportLibrary :: ComputeTool
--- /dev/null
+-- File: WOKStep_Include.cdl
+-- Created: Thu Jun 27 17:24:05 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class Include from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose: Liste les includes publics de l'etape
+ -- (lie dans le repertoire des includes publics
+ -- les includes publics sources.
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfStepOption from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable Include from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end Include;
--- /dev/null
+// File: WOKStep_Include.cxx
+// Created: Thu Oct 26 20:10:02 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <unistd.h>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Param.hxx>
+#include <WOKUtils_Path.hxx>
+
+#include <WOKernel_Session.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKBuilder_Include.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_Include.ixx>
+
+#ifdef WNT
+# include <tchar.h>
+# include <WOKNT_WNT_BREAK.hxx>
+
+extern "C" int __declspec( dllimport ) wokCP ( int, char** );
+extern "C" int __declspec( dllimport ) wokCMP ( int, char** );
+
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_Include
+//purpose :
+//=======================================================================
+ WOKStep_Include::WOKStep_Include(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Include::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)DBADMFILE);
+ return result;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Include::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)DBTMPDIR);
+ return result;
+}
+
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_Include::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_HFile:
+ case WOKUtils_HXXFile:
+ case WOKUtils_LXXFile:
+ case WOKUtils_GXXFile:
+ case WOKUtils_IDLFile:
+ case WOKUtils_INCFile:
+ result = new WOKBuilder_Include(apath); break;
+ default:
+ return Standard_False;
+ }
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ else
+ {
+ return Standard_False;
+ }
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_Include::Execute(const Handle(WOKMake_HSequenceOfInputFile)& tobuild)
+{
+ Standard_Integer i;
+ Handle(WOKernel_File) incfile;
+ Handle(WOKernel_File) pubincfile;
+ Handle(WOKernel_FileType) sourcetype = Unit()->FileTypeBase()->Type("source");
+ Handle(WOKernel_FileType) pubinctype = Unit()->FileTypeBase()->Type("pubinclude");
+
+ Handle(WOKMake_InputFile) infile;
+
+ for(i=1; i<=tobuild->Length(); i++)
+ {
+#ifdef WNT
+ _TEST_BREAK();
+#endif // WNT
+ infile = tobuild->Value(i);
+
+ // include de type source local au wb
+ pubincfile = new WOKernel_File(infile->File()->Name(), Unit(), pubinctype);
+ pubincfile->GetPath();
+
+ if(infile->File()->Nesting()->IsSameString(Unit()->FullName()))
+ {
+ if(pubincfile->Path()->Exists())
+ {
+ pubincfile->Path()->RemoveFile();
+ }
+
+#ifndef WNT
+ symlink(infile->File()->Path()->Name()->ToCString(), pubincfile->Path()->Name()->ToCString());
+#else
+ Standard_CString CmpArgs[4];
+
+ CmpArgs[0] = "wokCMP";
+ CmpArgs[1] = infile->File()->Path()->Name()->ToCString();
+ CmpArgs[2] = pubincfile->Path()->Name()->ToCString();
+ if(wokCMP(3, CmpArgs))
+ {
+ Standard_CString CpArgs[4];
+
+ CpArgs[0] = "wokCP";
+ CpArgs[1] = infile->File()->Path()->Name()->ToCString();
+ CpArgs[2] = pubincfile->Path()->Name()->ToCString();
+ wokCP(3, CpArgs);
+ }
+#endif
+ }
+ else
+ {
+ pubincfile->Path()->RemoveFile();
+ }
+
+
+ pubincfile = Locator()->Locate(Unit()->Name(), pubinctype->Name(), infile->File()->Name());
+
+ if(!pubincfile.IsNull())
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(pubincfile->LocatorName(), pubincfile,
+ Handle(WOKBuilder_Entity)(), pubincfile->Path());
+ outfile->SetProduction();
+ outfile->SetLocateFlag(Standard_True);
+
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+
+ SetSucceeded();
+ return;
+}
+
--- /dev/null
+-- File: WOKStep_LibExtract.cdl
+-- Created: Wed Jul 24 10:20:56 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+class LibExtract from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable LibExtract from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ ---Purpose: 1 - Adds File In list if file is compilable or an admfile
+ -- 2 - Sets Build Flag if file is a compilable
+ returns Boolean from Standard
+ is redefined protected;
+
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end LibExtract;
--- /dev/null
+// File: WOKStep_LibExtract.cxx
+// Created: Tue Aug 6 11:02:26 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Extension.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_FileType.hxx>
+
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_CompressedFile.hxx>
+#include <WOKBuilder_Command.hxx>
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_ArchiveExtract.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_LibExtract.ixx>
+
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : WOKStep_LibExtract
+//purpose :
+//=======================================================================
+WOKStep_LibExtract::WOKStep_LibExtract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKMake_Step(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LibExtract::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LibExtract::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_LibExtract::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_ArchiveFile:
+ result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_CompressedFile:
+ result = new WOKBuilder_CompressedFile(apath); break;
+ default:
+ return Standard_False;
+ }
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_LibExtract::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(WOKBuilder_ArchiveExtract) anext = new WOKBuilder_ArchiveExtract(Unit()->Params());
+ Standard_Integer i,j;
+ Standard_Boolean stepfailed = Standard_False;
+ Standard_Boolean failed = Standard_False;
+ Standard_Boolean wascompressed;
+
+ anext->SetShell(Shell());
+
+ Shell()->Launch();
+
+ anext->SetOutputDir(OutputDir());
+
+ Handle(WOKernel_FileType) objtype = Unit()->GetFileType("object");
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ wascompressed = Standard_False;
+ failed = Standard_False;
+
+ if(infile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_ArchiveLibrary)))
+ {
+ anext->SetArchive(Handle(WOKBuilder_ArchiveLibrary)::DownCast(infile->BuilderEntity()));
+ }
+ else if (infile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_CompressedFile)))
+ {
+ Handle(WOKBuilder_Command) acmd = new WOKBuilder_Command(new TCollection_HAsciiString("COMMAND"),
+ Unit()->Params());
+
+ Handle(WOKernel_File) liba = new WOKernel_File(infile->File()->Path()->BaseName(), Unit(), Unit()->GetFileType("sttmpfile"));
+ liba->GetPath();
+
+ acmd->SetShell(Shell());
+
+
+
+ switch(acmd->UnCompressTo(infile->File()->Path(), liba->Path()))
+ {
+ case WOKBuilder_Success:
+ {
+ Handle(WOKBuilder_ArchiveLibrary) anent = new WOKBuilder_ArchiveLibrary(liba->Path());
+ InfoMsg << "WOKStep_TKLibUnCompress::Execute"
+ << "Uncompress : " << infile->File()->UserPathName() << endm;
+
+ anext->SetArchive(anent);
+ wascompressed = Standard_True;
+ }
+ break;
+ case WOKBuilder_Failed:
+ failed = Standard_True;
+ break;
+ default:
+ break;
+ }
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_LibExtract::Execute"
+ << "Unrecognized input file : " << infile->ID() << endm;
+ SetFailed();
+ return;
+ }
+
+
+ if(!failed)
+ {
+ InfoMsg << "WOKStep_LibExtract::Execute"
+ << "Extracting : " << infile->File()->UserPathName() << endm;
+
+ switch(anext->Execute())
+ {
+ case WOKBuilder_Success:
+ {
+ Handle(WOKBuilder_HSequenceOfEntity) aseq = anext->Produces();
+
+ for(j=1; j<=aseq->Length(); j++)
+ {
+ Handle(WOKBuilder_Entity) anent = aseq->Value(j);
+
+ if(anent->IsKind(STANDARD_TYPE(WOKBuilder_ObjectFile)))
+ {
+ Handle(WOKernel_File) Kfile = new WOKernel_File(anent->Path()->FileName(), Unit(), objtype);
+ Kfile->GetPath();
+ anent->Path()->MoveTo(Kfile->Path());
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(Kfile->LocatorName(), Kfile, anent, anent->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ else
+ {
+ WarningMsg << "WOKStep_LibExtract::Execute"
+ << "Ignoring non object result : " << anent->Path()->Name() << endm;
+ failed = Standard_True;
+ }
+ }
+ }
+ break;
+ case WOKBuilder_Failed:
+ failed = Standard_True;
+ break;
+ default:
+ break;
+ }
+ }
+
+ stepfailed |= failed;
+ if(wascompressed)
+ {
+ anext->Archive()->Path()->RemoveFile();
+ }
+ }
+
+ if(stepfailed) SetFailed();
+ else SetSucceeded();
+
+ return;
+}
--- /dev/null
+-- File: WOKStep_LibLimit.cdl
+-- Created: Thu Jan 9 14:55:41 1997
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+
+class LibLimit from WOKStep
+inherits MetaStep from WOKMake
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable LibLimit from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ ---Purpose: 1 - Adds File In list if file is compilable or an admfile
+ -- 2 - Sets Build Flag if file is a compilable
+ returns Boolean from Standard
+ is redefined protected;
+
+ OutOfDateEntities(me:mutable)
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end LibLimit;
+
--- /dev/null
+// File: WOKStep_LibLimit.cxx
+// Created: Thu Jan 9 14:57:06 1997
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+
+
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+#include <WOKTools_MapIteratorOfMapOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Extension.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_Session.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_FileType.hxx>
+
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_Command.hxx>
+#include <WOKBuilder_ArchiveExtract.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#ifndef WNT
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_SharedLibrary.hxx>
+#else
+#include <WOKBuilder_StaticLibrary.hxx>
+#include <WOKBuilder_ImportLibrary.hxx>
+#endif
+#include <WOKBuilder_Miscellaneous.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_LibLimit.ixx>
+
+
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : WOKStep_LibLimit
+//purpose :
+//=======================================================================
+WOKStep_LibLimit::WOKStep_LibLimit(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKMake_MetaStep(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LibLimit::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LibLimit::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_LibLimit::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_ObjectFile:
+ {
+ if(SubCode().IsNull())
+ result = new WOKBuilder_ObjectFile(apath);
+ else
+ {
+ Handle(WOKernel_DevUnit) entity = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ if(entity->Name()->IsSameString(SubCode()))
+ result = new WOKBuilder_ObjectFile(apath);
+ else
+ return Standard_False;
+ }
+ }
+ break;
+#ifndef WNT
+ case WOKUtils_ArchiveFile: result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_DSOFile: result = new WOKBuilder_SharedLibrary(apath); break;
+#else
+ case WOKUtils_LIBFile: result = new WOKBuilder_StaticLibrary(apath); break;
+ case WOKUtils_IMPFile: result = new WOKBuilder_ImportLibrary(apath); break;
+#endif // WNT
+ default:
+ break;
+ }
+
+ if(result.IsNull())
+ {
+ if(!strcmp(apath->ExtensionName()->ToCString(), ".ImplDep"))
+ {
+ result = new WOKBuilder_Miscellaneous(apath);
+ }
+ }
+ if(!result.IsNull())
+ {
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_LibLimit::OutOfDateEntities()
+{
+ return ForceBuild();
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_LibLimit::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(TCollection_HAsciiString) anbstr = Unit()->Params().Eval("%LDSHR_LibLimit",Standard_True);
+ Standard_Integer limit = 0, i, j;
+
+ if(anbstr.IsNull())
+ {
+ limit = 0;
+ }
+ else
+ {
+ if(anbstr->IsIntegerValue())
+ {
+ limit = anbstr->IntegerValue();
+ }
+ }
+
+ if(SubCode().IsNull())
+ {
+ Standard_Boolean ok = Standard_True;
+
+ if(limit && (limit < execlist->Length()))
+ {
+ WOKTools_MapOfHAsciiString umap;
+ Standard_Integer i;
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ const Handle(WOKMake_InputFile)& infile = execlist->Value(i);
+
+ if(infile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_ObjectFile)) && infile->IsLocateAble())
+ {
+ if(infile->IsLocateAble())
+ {
+ Handle(WOKernel_DevUnit) entity = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+
+ if(!entity.IsNull())
+ {
+ if(!umap.Contains(entity->Name()))
+ {
+ umap.Add(entity->Name());
+ }
+ }
+ }
+ }
+ else
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(infile);
+
+ outfile->SetReference();
+ outfile->SetExtern();
+
+ Handle(WOKernel_DevUnit) unit = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ if(!unit.IsNull())
+ {
+ if(!strcmp(unit->Name()->ToCString(), Unit()->Name()->ToCString()))
+ outfile->SetMember();
+ }
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+
+ WOKTools_MapIteratorOfMapOfHAsciiString it(umap);
+
+ for(;it.More();it.Next())
+ {
+ Handle(TCollection_HAsciiString) part = it.Key();
+
+ Handle(TCollection_HAsciiString) id = WOKMake_Step::StepOutputID(Unit()->Name(),
+ Code(),
+ part);
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(id, Handle(WOKernel_File)(),
+ Handle(WOKBuilder_Entity)(), Handle(WOKUtils_Path)());
+ outfile->SetProduction();
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetPhysicFlag(Standard_False);
+ outfile->SetStepID(Standard_True);
+
+ Handle(WOKMake_Step) astep = BuildProcess()->GetAndAddStep(Unit(), Code(), it.Key());
+
+ astep->DoExecute();
+ astep->SetTargets(Targets());
+ astep->SetOptions(Options());
+
+ switch(astep->Make())
+ {
+ case WOKMake_Uptodate:
+ InfoMsg << "WOKStep_LibLimit::Execute"
+ << "========> " << astep->SubCode() << " is uptodate" << endm;
+ break;
+ case WOKMake_Success:
+ InfoMsg << "WOKStep_LibLimit::Execute"
+ << "========> " << astep->SubCode() << " succeeded" << endm;
+ break;
+ case WOKMake_Incomplete:
+ WarningMsg << "WOKStep_LibLimit::Execute"
+ << "========> " << astep->SubCode() << " is incomplete" << endm;
+ break;
+ case WOKMake_Failed:
+ ErrorMsg << "WOKStep_LibLimit::Execute"
+ << "========> " << astep->SubCode() << " failed" << endm;
+ ok = Standard_False;
+ break;
+ case WOKMake_Unprocessed:
+ WarningMsg << "WOKStep_LibLimit::Execute"
+ << "========> " << astep->SubCode() << " is still unprocessed" << endm;
+ ok=Standard_False;
+ break;
+ }
+ Handle(TCollection_HAsciiString) Theid = WOKMake_Step::StepOutputID(Unit()->Name(),
+ astep->Code(),
+ astep->SubCode());
+ Handle(WOKMake_OutputFile) theoutfile = new WOKMake_OutputFile(Theid, Handle(WOKernel_File)(),
+ Handle(WOKBuilder_Entity)(),
+ Handle(WOKUtils_Path)());
+ theoutfile->SetProduction();
+ theoutfile->SetLocateFlag(Standard_True);
+ theoutfile->SetPhysicFlag(Standard_False);
+ theoutfile->SetStepID(Standard_True);
+
+ for(j=1; j<=execlist->Length(); j++)
+ {
+ const Handle(WOKMake_InputFile)& infile = execlist->Value(j);
+ const Handle(WOKernel_DevUnit)& entity = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ if(entity->Name()->IsSameString(astep->SubCode()))
+ AddExecDepItem(infile,theoutfile, Standard_True);
+ }
+ }
+ }
+ else
+ {
+ InfoMsg << "WOKStep_LibLimit::Execute"
+ << "No limitation required" << endm;
+ for( i=1; i<=execlist->Length(); i++)
+ {
+ const Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(infile);
+ AddExecDepItem(execlist->Value(i), outfile, Standard_True);
+ }
+ }
+ if(ok) SetSucceeded();
+ else SetFailed();
+ }
+ else
+ {
+ for( i=1; i<=execlist->Length(); i++)
+ {
+ const Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(infile);
+ AddExecDepItem(execlist->Value(i), outfile, Standard_True);
+ }
+ SetSucceeded();
+ }
+
+}
--- /dev/null
+-- File: WOKStep_LibLink.cdl
+-- Created: Thu Aug 1 18:49:45 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+class LibLink from WOKStep
+inherits Link from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection
+
+is
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable LibLink from WOKStep;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+
+end LibLink;
--- /dev/null
+// File: WOKStep_LibLink.cxx
+// Created: Fri Aug 2 10:07:33 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+
+#include <WOKernel_File.hxx>
+
+#include <WOKBuilder_SharedLinker.hxx>
+#include <WOKBuilder_SharedLibrary.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_Library.hxx>
+#include <WOKBuilder_HSequenceOfObjectFile.hxx>
+#include <WOKBuilder_HSequenceOfLibrary.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+
+#include <WOKStep_LibLink.ixx>
+
+//=======================================================================
+//function : WOKStep_LibLink
+//purpose :
+//=======================================================================
+WOKStep_LibLink::WOKStep_LibLink(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_Link(abp,aunit,acode,checked,hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_LibLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i,j;
+ Handle(WOKBuilder_Library) alib;
+ Handle(TCollection_HAsciiString) libname;
+ Handle(WOKUtils_Path) apath;
+
+ mylinker = new WOKBuilder_SharedLinker(new TCollection_HAsciiString("LINKSHR"),
+ Unit()->Params());
+
+ Handle(TColStd_HSequenceOfHAsciiString) externals = new TColStd_HSequenceOfHAsciiString;
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("external", infile->ID()->Token(":", 2)->ToCString()))
+ {
+ Handle(TCollection_HAsciiString) astr = new TCollection_HAsciiString("%");
+ astr->AssignCat(infile->ID()->Token(":", 3));
+
+ externals->Append(astr);
+ }
+ }
+ }
+
+ if(SubCode().IsNull())
+ {
+ libname = WOKBuilder_SharedLibrary::GetLibFileName(Unit()->Params(), Unit()->Name());
+ }
+ else
+ {
+ libname = WOKBuilder_SharedLibrary::GetLibFileName(Unit()->Params(), SubCode());
+ }
+
+ Handle(WOKBuilder_SharedLinker) ashld = Handle(WOKBuilder_SharedLinker)::DownCast(mylinker);
+ if(!ashld.IsNull())
+ {
+ ashld->SetLogicalName(libname);
+ }
+
+ if(SubCode().IsNull())
+ {
+ mytarget = Unit()->Name();
+ }
+ else
+ {
+ mytarget = SubCode();
+ }
+
+ myexternals = externals;
+ myobjects = ComputeObjectList(execlist);
+ mylibraries = ComputeLibraryList(execlist);
+ mylibpathes = ComputeLibrarySearchList(execlist);
+ mydbdirs = ComputeDatabaseDirectories();
+
+ if(Status()==WOKMake_Failed)
+ return;
+
+ Handle(WOKMake_HSequenceOfOutputFile) outfiles = new WOKMake_HSequenceOfOutputFile;
+ WOKMake_Status status;
+
+ status = ExecuteLink(outfiles);
+
+ switch(status)
+ {
+ case WOKMake_Success:
+ if(!outfiles.IsNull())
+ {
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ for(j=1; j<=outfiles->Length(); j++)
+ {
+ AddExecDepItem(execlist->Value(i), outfiles->Value(j), Standard_True);
+ }
+ }
+ }
+ break;
+ case WOKMake_Uptodate:
+ case WOKMake_Incomplete:
+ case WOKMake_Failed:
+ case WOKMake_Unprocessed:
+ break;
+ }
+
+ SetStatus(status);
+ return;
+}
--- /dev/null
+-- File: WOKStep_LibUnCompress.cdl
+-- Created: Thu Jul 18 13:19:23 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+
+class LibUnCompress from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable LibUnCompress from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ ---Purpose: 1 - Adds File In list if file is compilable or an admfile
+ -- 2 - Sets Build Flag if file is a compilable
+ returns Boolean from Standard
+ is redefined protected;
+
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end LibUnCompress;
--- /dev/null
+// File: WOKStep_LibUnCompress.cxx
+// Created: Thu Jul 18 13:23:36 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Extension.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_File.hxx>
+
+#include <WOKBuilder_CompressedFile.hxx>
+#include <WOKBuilder_Command.hxx>
+#include <WOKBuilder_ArchiveLibrary.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_LibUnCompress.ixx>
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : WOKStep_LibUnCompress
+//purpose :
+//=======================================================================
+WOKStep_LibUnCompress::WOKStep_LibUnCompress(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKMake_Step(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LibUnCompress::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LibUnCompress::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_LibUnCompress::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_CompressedFile:
+ result = new WOKBuilder_CompressedFile(apath); break;
+ default:
+ return Standard_False;
+ }
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_LibUnCompress::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(WOKBuilder_Command) acmd = new WOKBuilder_Command(new TCollection_HAsciiString("COMMAND"), Unit()->Params());
+ Standard_Integer i;
+
+ acmd->SetShell(Shell());
+
+ if(!Shell()->IsLaunched()) Shell()->Launch();
+
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+
+ Handle(WOKernel_File) liba = new WOKernel_File(infile->File()->Path()->BaseName(), Unit(), Unit()->GetFileType("archive"));
+
+ liba->GetPath();
+
+ InfoMsg << "WOKStep_LibUnCompress::Execute"
+ << "Uncompress : " << infile->File()->UserPathName() << endm;
+
+ switch(acmd->UnCompressTo(infile->File()->Path(), liba->Path()))
+ {
+ case WOKBuilder_Success:
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(liba->LocatorName(), liba,
+ new WOKBuilder_ArchiveLibrary(liba->Path()), liba->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ break;
+ case WOKBuilder_Failed:
+ break;
+ default:
+ break;
+ }
+ }
+ SetSucceeded();
+}
--- /dev/null
+-- File: WOKStep_Library.cdl
+-- Created: Thu Jun 27 17:27:50 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+deferred class Library from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+is
+ Initialize(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard);
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ CompleteExecList(me:mutable; anexeclist : HSequenceOfInputFile from WOKMake)
+ is redefined protected;
+
+end Library;
--- /dev/null
+// File: WOKStep_Library.cxx
+// Created: Tue Jan 9 19:36:08 1996
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Extension.hxx>
+
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_File.hxx>
+
+#include <WOKBuilder_ObjectFile.hxx>
+#ifndef WNT
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_SharedLibrary.hxx>
+#else
+#include <WOKBuilder_StaticLibrary.hxx>
+#include <WOKBuilder_ImportLibrary.hxx>
+#endif
+#include <WOKBuilder_Miscellaneous.hxx>
+
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_Library.ixx>
+
+//=======================================================================
+//function : WOKStep_Library
+//purpose :
+//=======================================================================
+ WOKStep_Library::WOKStep_Library(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp,aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Library::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Library::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_Library::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_ObjectFile: result = new WOKBuilder_ObjectFile(apath); break;
+#ifndef WNT
+ case WOKUtils_ArchiveFile: result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_DSOFile: result = new WOKBuilder_SharedLibrary(apath); break;
+#else
+ case WOKUtils_LIBFile: result = new WOKBuilder_StaticLibrary(apath); break;
+ case WOKUtils_IMPFile: result = new WOKBuilder_ImportLibrary(apath); break;
+#endif // WNT
+ default:
+ break;
+ }
+
+ if(result.IsNull())
+ {
+ if(!strcmp(apath->ExtensionName()->ToCString(), ".ImplDep"))
+ {
+ result = new WOKBuilder_Miscellaneous(apath);
+ }
+ }
+ if(!result.IsNull())
+ {
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : CompleteExecList
+//purpose :
+//=======================================================================
+void WOKStep_Library::CompleteExecList(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ if((execlist->Length() != 0) && (myinflow.Extent() > execlist->Length()) && (!mydepmatrix.IsNull()))
+ {
+ WOKTools_MapOfHAsciiString amap;
+ Standard_Integer i;
+
+ for(i=1; i<=execlist->Length();i++)
+ {
+ amap.Add(execlist->Value(i)->ID());
+ }
+
+ Standard_Boolean found = Standard_False;
+ for(i=1; i<=myinflow.Extent() && !found; i++)
+ {
+ if(!amap.Contains(myinflow(i)->ID()))
+ {
+ execlist->Append(myinflow(i));
+ found = Standard_True;
+ }
+ }
+ }
+
+ WOKMake_Step::CompleteExecList(execlist);
+ return;
+}
--- /dev/null
+-- File: WOKStep_Link.cdl
+-- Created: Thu Jun 27 17:35:05 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+deferred class Link from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose: Provides services for link Purposes
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfOutputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ Status from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ UnitGraph from WOKernel,
+ Linker from WOKBuilder,
+ Entity from WOKBuilder,
+ HSequenceOfEntity from WOKBuilder,
+ ObjectFile from WOKBuilder,
+ HSequenceOfObjectFile from WOKBuilder,
+ Library from WOKBuilder,
+ HSequenceOfLibrary from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection,
+ HSequenceOfHAsciiString from TColStd
+
+is
+
+ Initialize(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard);
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ CompleteExecList(me:mutable; anexeclist : HSequenceOfInputFile from WOKMake)
+ is redefined protected;
+
+ ComputeTool(me:mutable)
+ returns mutable Linker from WOKBuilder
+ is virtual protected;
+
+ ComputeTarget(me:mutable)
+ returns mutable Entity from WOKBuilder
+ is virtual protected;
+
+ ComputeObjectList(me:mutable; input : HSequenceOfInputFile from WOKMake)
+ returns mutable HSequenceOfObjectFile from WOKBuilder
+ is virtual protected;
+
+ ComputeLibraryList(me:mutable; input : HSequenceOfInputFile from WOKMake)
+ returns mutable HSequenceOfLibrary from WOKBuilder
+ is virtual protected;
+
+ ComputeLibrarySearchList(me:mutable; input : HSequenceOfInputFile from WOKMake)
+ returns mutable HSequenceOfPath from WOKUtils
+ is virtual protected;
+
+ ComputeDatabaseDirectories(me)
+ returns HSequenceOfPath from WOKUtils is protected;
+
+ ExecuteLink(me:mutable; output : out HSequenceOfOutputFile from WOKMake)
+ returns Status from WOKMake;
+
+
+fields
+
+ mylinker : Linker from WOKBuilder is protected;
+ mytarget : HAsciiString from TCollection is protected;
+ myobjects : HSequenceOfObjectFile from WOKBuilder is protected;
+ mylibpathes : HSequenceOfPath from WOKUtils is protected;
+ mydbdirs : HSequenceOfPath from WOKUtils is protected;
+ mylibraries : HSequenceOfLibrary from WOKBuilder is protected;
+ myexternals : HSequenceOfHAsciiString from TColStd is protected;
+
+end Link;
--- /dev/null
+// File: WOKStep_Link.cxx
+// Created: Tue Aug 29 21:41:14 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_MapOfPath.hxx>
+#include <WOKUtils_MapIteratorOfMapOfPath.hxx>
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Param.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_Session.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_Parcel.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_UnitGraph.hxx>
+#include <WOKernel_Locator.hxx>
+
+
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_SharedLibrary.hxx>
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_Executable.hxx>
+#include <WOKBuilder_Linker.hxx>
+#include <WOKBuilder_Miscellaneous.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfInputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_Link.ixx>
+
+//=======================================================================
+//function : WOKStep_Link
+//purpose :
+//=======================================================================
+ WOKStep_Link::WOKStep_Link(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Link::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Link::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_Link::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->IsPhysic())
+ return Standard_True;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ }
+ else
+ {
+ apath = infile->LastPath();
+ }
+
+ if(!apath.IsNull())
+ {
+ switch(apath->Extension())
+ {
+ case WOKUtils_ObjectFile: result = new WOKBuilder_ObjectFile(apath); break;
+ case WOKUtils_ArchiveFile: result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_DSOFile: result = new WOKBuilder_SharedLibrary(apath); break;
+ default:
+ return Standard_False;
+ }
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+
+
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : CompleteExecList
+//purpose :
+//=======================================================================
+void WOKStep_Link::CompleteExecList(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+
+ if((execlist->Length() != 0) && (myinflow.Extent() > execlist->Length()) && (!mydepmatrix.IsNull()))
+ {
+ WOKTools_MapOfHAsciiString amap;
+ Standard_Integer i;
+
+ for(i=1; i<=execlist->Length();i++)
+ {
+ amap.Add(execlist->Value(i)->ID());
+ }
+
+ Standard_Boolean found = Standard_False;
+ for(i=1; i<=myinflow.Extent() && !found; i++)
+ {
+ if(!amap.Contains(myinflow(i)->ID()))
+ {
+ execlist->Append(myinflow(i));
+ found = Standard_True;
+ }
+ }
+ }
+
+ WOKMake_Step::CompleteExecList(execlist);
+
+ return;
+}
+
+
+//=======================================================================
+//function : ComputeTool
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_Linker) WOKStep_Link::ComputeTool()
+{
+ return Handle(WOKBuilder_Linker)();
+}
+
+//=======================================================================
+//function : ComputeTarget
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_Entity) WOKStep_Link::ComputeTarget()
+{
+ return Handle(WOKBuilder_Entity)();
+}
+
+//=======================================================================
+//function : ComputeObjectList
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_HSequenceOfObjectFile) WOKStep_Link::ComputeObjectList(const Handle(WOKMake_HSequenceOfInputFile)& tobuild)
+{
+ Standard_Integer i;
+ Handle(WOKBuilder_HSequenceOfObjectFile) result = new WOKBuilder_HSequenceOfObjectFile;
+ Handle(WOKBuilder_ObjectFile) anobject;
+
+ for(i=1; i<=tobuild->Length(); i++)
+ {
+ anobject = Handle(WOKBuilder_ObjectFile)::DownCast(tobuild->Value(i)->BuilderEntity());
+
+ if(!anobject.IsNull())
+ {
+ result->Append(anobject);
+ }
+ }
+ return result;
+}
+
+
+//=======================================================================
+//function : ComputeLibraryList
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_HSequenceOfLibrary) WOKStep_Link::ComputeLibraryList(const Handle(WOKMake_HSequenceOfInputFile)& execlist )
+{
+ Standard_Integer i;
+ Handle(WOKernel_File) alib;
+ Handle(WOKernel_DevUnit) aunit;
+ Handle(WOKernel_UnitNesting) anesting;
+ WOKBuilder_LibReferenceType reftype;
+ Handle(WOKBuilder_SharedLibrary) ashlib;
+ Handle(TCollection_HAsciiString) libname;
+ Handle(WOKBuilder_HSequenceOfLibrary) aseq = new WOKBuilder_HSequenceOfLibrary;
+ static Handle(TCollection_HAsciiString) libtype = new TCollection_HAsciiString("library");
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKBuilder_Entity) anent = infile->BuilderEntity();
+ Handle(WOKBuilder_SharedLibrary) library;
+ Handle(WOKBuilder_ArchiveLibrary) archive;
+
+ library = Handle(WOKBuilder_SharedLibrary)::DownCast(anent);
+
+ if(!library.IsNull())
+ {
+ aunit = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ anesting = aunit->Session()->GetUnitNesting(aunit->Nesting());
+
+ reftype = WOKBuilder_ShortRef;
+#if 0
+ if(anesting->IsKind(STANDARD_TYPE(WOKernel_Workbench)))
+ {
+ reftype = WOKBuilder_LongRef;
+ // modif K2 on tire les .so via -L -l
+ //reftype = WOKBuilder_FullPath;
+ }
+ else
+ {
+ if(anesting->IsKind(STANDARD_TYPE(WOKernel_Parcel)))
+ {
+ reftype = WOKBuilder_LongRef;
+ }
+ else
+ {
+ WarningMsg << "WOKStep_LinkList::GetUnitLibrary"
+ << "Unknown Nesting for " << aunit->UserPathName() << endm;
+ }
+ }
+#endif
+
+ ashlib = new WOKBuilder_SharedLibrary(aunit->Name(), new WOKUtils_Path, WOKBuilder_FullPath);
+ libname = ashlib->GetLibFileName(Unit()->Params());
+
+ alib = Locator()->Locate(aunit->Name(), libtype, libname);
+
+ if(alib.IsNull())
+ {
+ ErrorMsg << "WOKStep_Link::ComputeLibraryList"
+ << "Could not find library in unit : " << aunit->UserPathName() << endm;
+ SetFailed();
+ }
+
+ ashlib = new WOKBuilder_SharedLibrary(aunit->Name(),
+ new WOKUtils_Path(alib->Path()->DirName()),
+ reftype);
+
+ aseq->Append(ashlib);
+
+ }
+ archive = Handle(WOKBuilder_ArchiveLibrary)::DownCast(anent);
+
+ if(!archive.IsNull())
+ {
+ archive->SetReferenceType(WOKBuilder_FullPath);
+ aseq->Append(archive);
+ }
+
+ }
+
+ return aseq;
+}
+
+//=======================================================================
+//function : ComputeDatabaseDirectories
+//purpose :
+//=======================================================================
+Handle(WOKUtils_HSequenceOfPath) WOKStep_Link::ComputeDatabaseDirectories() const
+{
+ Handle(WOKUtils_HSequenceOfPath) aseq;
+
+ if(Unit()->Params().Eval("%WOKSteps_UseDatabaseDirectory").IsNull())
+ {
+ return aseq;
+ }
+
+ Handle(TColStd_HSequenceOfHAsciiString) nestingseq = Unit()->Session()->GetWorkbench(Unit()->Nesting())->Visibility();
+ Handle(TCollection_HAsciiString) aname;
+ Handle(WOKernel_File) afile;
+ Handle(WOKernel_FileType) atype;
+ Handle(WOKernel_DevUnit) aunit;
+ Handle(TCollection_HAsciiString) DOT = new TCollection_HAsciiString(".");
+ WOKTools_MapOfHAsciiString amap;
+ Standard_Integer i;
+
+ aseq = new WOKUtils_HSequenceOfPath;
+
+ for(i=1; i<=nestingseq->Length(); i++)
+ {
+ Handle(WOKernel_UnitNesting) nesting = Unit()->Session()->GetUnitNesting(nestingseq->Value(i));
+ // les wbs uniquement
+ if(nesting->IsKind(STANDARD_TYPE(WOKernel_Workbench))) {
+ atype = nesting->FileTypeBase()->Type("libdir");
+ afile = new WOKernel_File(DOT, nesting, atype);
+ afile->GetPath();
+ if(!amap.Contains(afile->Path()->Name()))
+ {
+ aseq->Append(afile->Path());
+ amap.Add(afile->Path()->Name());
+ }
+ }
+ }
+
+ return aseq;
+}
+
+
+
+//=======================================================================
+//function : ComputeLibrarySearchList
+//purpose :
+//=======================================================================
+Handle(WOKUtils_HSequenceOfPath) WOKStep_Link::ComputeLibrarySearchList(const Handle(WOKMake_HSequenceOfInputFile)& execlist )
+{
+ Standard_Integer i;
+ WOKUtils_MapOfPath amapin, amapcalc;
+ Handle(WOKUtils_HSequenceOfPath) result = new WOKUtils_HSequenceOfPath;
+ Handle(WOKernel_DevUnit) aunit;
+
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+ Handle(WOKBuilder_Entity) anent = infile->BuilderEntity();
+ Handle(WOKBuilder_Library) library;
+
+ library = Handle(WOKBuilder_Library)::DownCast(anent);
+
+ if(!library.IsNull())
+ {
+ Handle(WOKernel_DevUnit) aunit = Unit()->Session()->GetDevUnit(infile->File()->Nesting());
+ Handle(WOKernel_UnitNesting) anesting = aunit->Session()->GetUnitNesting(aunit->Nesting());
+
+ Handle(WOKUtils_Path) adir = new WOKUtils_Path(library->Path()->DirName());
+
+ adir = adir->ReducedPath();
+
+ if(!amapin.Contains(adir))
+ {
+ amapin.Add(adir);
+ }
+ }
+ }
+
+ Handle(TColStd_HSequenceOfHAsciiString) avisiblity = Locator()->Visibility();
+
+ for(i=1; i<=avisiblity->Length(); i++)
+ {
+ static Handle(TCollection_HAsciiString) libdirtype = new TCollection_HAsciiString("libdir");
+
+ Handle(WOKernel_UnitNesting) anesting = Unit()->Session()->GetUnitNesting(avisiblity->Value(i));
+
+ Handle(WOKernel_File) libdir = new WOKernel_File(anesting, anesting->GetFileType(libdirtype));
+
+ libdir->GetPath();
+
+ Handle(WOKUtils_Path) adir = libdir->Path()->ReducedPath();
+
+ if(!amapcalc.Contains(adir))
+ {
+ amapcalc.Add(adir);
+ result->Append(adir);
+ }
+ }
+
+ WOKUtils_MapIteratorOfMapOfPath anit(amapin);
+
+ while(anit.More())
+ {
+ if(!amapcalc.Contains(anit.Key()))
+ {
+ WarningMsg << "WOKStep_Link::ComputeLibrarySearchList"
+ << "Library directory " << anit.Key()->Name() << " referenced in link is not in visibility" << endm;
+ }
+ anit.Next();
+ }
+ return result;
+}
+
+//=======================================================================
+//function : ExecuteLink
+//purpose :
+//=======================================================================
+WOKMake_Status WOKStep_Link::ExecuteLink(Handle(WOKMake_HSequenceOfOutputFile)& outputfiles)
+{
+ Standard_Integer i;
+ Handle(WOKernel_Entity) objentity;
+ Handle(WOKernel_FileType) libtype = Unit()->GetFileType("library");
+ Handle(WOKernel_FileType) exectype = Unit()->GetFileType("executable");
+ Handle(WOKernel_FileType) stadmtype = Unit()->GetFileType("stadmfile");
+ Handle(WOKernel_File) lnkfile;
+ Handle(WOKernel_File) file;
+ Handle(TCollection_HAsciiString) bidname;
+
+ mylinker->SetOutputDir(OutputDir());
+
+ mylinker->SetTargetName(mytarget);
+ mylinker->SetObjectList(myobjects);
+ mylinker->SetLibraryList(mylibraries);
+ mylinker->SetLibrarySearchPathes(mylibpathes);
+ mylinker->SetDatabaseDirectories(mydbdirs);
+ mylinker->SetExternals(myexternals);
+
+ bidname = new TCollection_HAsciiString(mytarget);
+ bidname->AssignCat(".lnk");
+
+ lnkfile = new WOKernel_File(bidname, Unit(), stadmtype);
+ lnkfile->GetPath();
+ if(lnkfile->Path()->Exists()) lnkfile->Path()->RemoveFile();
+ if (!lnkfile->Path()->CreateFile()) {
+ ErrorMsg << "WOKStep_Link::ExecuteLink"
+ << "Enable to create link file " << lnkfile->Path()->Name()->ToCString() << endm;
+ }
+ Handle(WOKUtils_Shell) ashell = Shell();
+
+ ashell->Lock();
+ ashell->SetEcho();
+ ashell->LogInFile(lnkfile->Path());
+
+ if(!ashell->IsLaunched()) ashell->Launch();
+
+ mylinker->SetShell(ashell);
+
+ switch(mylinker->Execute())
+ {
+ case WOKBuilder_Success:
+ {
+ Handle(WOKBuilder_Entity) outent;
+ for(i=1; i<=mylinker->Produces()->Length(); i++)
+ {
+ outent = mylinker->Produces()->Value(i);
+
+ if(outent->IsKind(STANDARD_TYPE(WOKBuilder_SharedLibrary)))
+ file = new WOKernel_File(outent->Path()->FileName(), Unit(), libtype);
+ else
+ {
+ if(outent->IsKind(STANDARD_TYPE(WOKBuilder_Executable)))
+ file = new WOKernel_File(outent->Path()->FileName(), Unit(), exectype);
+ else if(outent->IsKind(STANDARD_TYPE(WOKBuilder_Miscellaneous)))
+ file = new WOKernel_File(outent->Path()->FileName(), Unit(), stadmtype);
+ }
+
+
+ file->GetPath();
+
+ // on prend de fait la liste des objets comme input des Produces du Link
+
+ // je l'y deplace
+ outent->Path()->MoveTo(file->Path());
+
+ if(outputfiles.IsNull())
+ outputfiles = new WOKMake_HSequenceOfOutputFile;
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(file->LocatorName(), file,
+ outent, file->Path());
+
+
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+
+ outputfiles->Append(outfile);
+
+ Handle(WOKMake_OutputFile) outlnk = new WOKMake_OutputFile(lnkfile->LocatorName(), lnkfile,
+ new WOKBuilder_Miscellaneous(lnkfile->Path()),
+ lnkfile->Path());
+ outlnk->SetLocateFlag(Standard_True);
+ outlnk->SetProduction();
+ outputfiles->Append(outlnk);
+ //
+ }
+ SetSucceeded();
+ }
+ break;
+ case WOKBuilder_Failed:
+ ErrorMsg << "WOKStep_Link::ExecuteLink" << "Failed : " << mytarget << endm;
+ SetFailed();
+ break;
+ }
+
+ ashell->UnsetEcho();
+ ashell->NoLog();
+ ashell->UnLock();
+
+ return Status();
+ }
--- /dev/null
+-- File: WOKStep_LinkList.cdl
+-- Created: Thu Aug 1 12:01:09 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+deferred class LinkList from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ OutputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ Status from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ Linker from WOKBuilder,
+ Entity from WOKBuilder,
+ HSequenceOfEntity from WOKBuilder,
+ ObjectFile from WOKBuilder,
+ HSequenceOfObjectFile from WOKBuilder,
+ Library from WOKBuilder,
+ HSequenceOfLibrary from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ MapOfHAsciiString from WOKTools,
+ HAsciiString from TCollection,
+ HSequenceOfHAsciiString from TColStd
+
+is
+
+ Initialize(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard);
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ LoadDependencies(me:mutable)
+ is redefined protected;
+
+ GetUnitLibrary(me:mutable; unit : DevUnit from WOKernel)
+ returns OutputFile from WOKMake is protected;
+
+ ComputeDependency(me; code : HAsciiString from TCollection; adirectlist : HSequenceOfHAsciiString from TColStd)
+ returns HSequenceOfHAsciiString from TColStd is deferred protected;
+
+ GetUnitContributionCodes(me; unit : DevUnit from WOKernel)
+ returns HAsciiString from TCollection is virtual protected;
+
+ AddParcelUnitContribution(me:mutable; theinfile : InputFile from WOKMake; unit : HAsciiString from TCollection)
+ is virtual protected;
+
+ AddWorkbenchUnitContribution(me:mutable; theinfile : InputFile from WOKMake; unit : HAsciiString from TCollection)
+ is virtual protected;
+
+ AddUnitContribution(me:mutable; theinfile : InputFile from WOKMake; unit : HAsciiString from TCollection)
+ is virtual protected;
+
+ ComputeExternals(me:mutable; aunit : HAsciiString from TCollection)
+ is virtual protected;
+
+end LinkList;
--- /dev/null
+// File: WOKStep_LinkList.cxx
+// Created: Fri Aug 2 10:06:51 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <TCollection_HAsciiString.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Extension.hxx>
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_AdmFile.hxx>
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_Parcel.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKBuilder_Entity.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_Miscellaneous.hxx>
+#ifndef WNT
+# include <WOKBuilder_ArchiveLibrary.hxx>
+# include <WOKBuilder_SharedLibrary.hxx>
+#else
+# include <WOKBuilder_StaticLibrary.hxx>
+# include <WOKBuilder_ImportLibrary.hxx>
+#endif // WNT
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+
+#include <WOKStep_LinkList.ixx>
+
+
+
+//=======================================================================
+//function : WOKStep_LinkList
+//purpose :
+//=======================================================================
+ WOKStep_LinkList::WOKStep_LinkList(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKMake_Step(abp,aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LinkList::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LinkList::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_LinkList::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+#ifdef WNT
+ case WOKUtils_RESFile:
+#endif
+ case WOKUtils_ObjectFile: result = new WOKBuilder_ObjectFile(apath); break;
+#ifndef WNT
+ case WOKUtils_ArchiveFile: result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_DSOFile: result = new WOKBuilder_SharedLibrary(apath); break;
+#else
+ case WOKUtils_LIBFile: result = new WOKBuilder_StaticLibrary(apath); break;
+ case WOKUtils_IMPFile: result = new WOKBuilder_ImportLibrary(apath); break;
+#endif // WNT
+ default:
+ return Standard_False;
+ }
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("msentity", infile->ID()->Token(":", 2)->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3)));
+ }
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : LoadDependencies
+//purpose :
+//=======================================================================
+void WOKStep_LinkList::LoadDependencies()
+{
+ // Do not load dependencies for this step
+ // to avoid AcquitExecution bug
+ return;
+}
+
+
+//=======================================================================
+//function : GetUnitLibrary
+//purpose :
+//=======================================================================
+Handle(WOKMake_OutputFile) WOKStep_LinkList::GetUnitLibrary(const Handle(WOKernel_DevUnit)& aunit)
+{
+ Handle(WOKUtils_Path) apath;
+ Handle(WOKMake_OutputFile) alib;
+ Handle(WOKernel_File) afile;
+ Handle(WOKernel_UnitNesting) anesting;
+ WOKBuilder_LibReferenceType reftype;
+ static Handle(TCollection_HAsciiString) libtype = new TCollection_HAsciiString("library");
+ Handle(TCollection_HAsciiString) libname;
+
+ anesting = aunit->Session()->GetUnitNesting(aunit->Nesting());
+
+ if(anesting->IsKind(STANDARD_TYPE(WOKernel_Workbench)))
+ {
+ reftype = WOKBuilder_FullPath;
+ }
+ else
+ {
+ if(anesting->IsKind(STANDARD_TYPE(WOKernel_Parcel)))
+ {
+ reftype = WOKBuilder_LongRef;
+ }
+ else
+ {
+ WarningMsg << "WOKStep_LinkList::GetUnitLibrary"
+ << "Unknown Nesting for " << aunit->UserPathName() << endm;
+ }
+ }
+
+
+
+ if(WOKernel_IsPackage(aunit) ||
+ WOKernel_IsNocdlpack(aunit) ||
+ WOKernel_IsToolkit(aunit) ||
+ WOKernel_IsSchema(aunit) ||
+ WOKernel_IsClient(aunit) ||
+ WOKernel_IsInterface(aunit) )
+ {
+#ifndef WNT
+ Handle(WOKBuilder_SharedLibrary) thelib = new WOKBuilder_SharedLibrary(aunit->Name(), apath, WOKBuilder_FullPath);
+#else
+ Handle(WOKBuilder_ImportLibrary) thelib = new WOKBuilder_ImportLibrary(aunit->Name(), apath, WOKBuilder_FullPath);
+#endif //WNT
+ libname = thelib->GetLibFileName(Unit()->Params());
+
+ afile = Locator()->Locate(aunit->Name(), libtype, libname);
+
+ if(afile.IsNull())
+ {
+ // verifier si c'est normal
+ Standard_Boolean mustExist = aunit->SearchInFileList(Locator(),libname);
+ if (mustExist)
+ {
+ ErrorMsg << "WOKStep_LinkList::GetUnitLibrary"
+ << "No library (" << libname << ") found for unit " << aunit->Name() << endm;
+ SetFailed();
+ }
+ else
+ WarningMsg << "WOKStep_LinkList::GetUnitLibrary"
+ << "No library (" << libname << ") in unit " << aunit->Name() << endm;
+ }
+ else
+ {
+ alib = new WOKMake_OutputFile(afile->LocatorName(), afile,
+#ifndef WNT
+ new WOKBuilder_SharedLibrary(aunit->Name(),
+ new WOKUtils_Path(afile->Path()->DirName()),
+ reftype),
+#else
+ new WOKBuilder_ImportLibrary(aunit->Name(),
+ new WOKUtils_Path(afile->Path()->DirName()),
+ reftype),
+#endif
+ afile->Path());
+
+ if(!strcmp(Unit()->Name()->ToCString(), aunit->Name()->ToCString()))
+ {
+ alib->SetMember();
+ }
+ else
+ {
+ alib->SetExtern();
+ }
+ alib->SetLocateFlag(Standard_True);
+ alib->SetReference();
+ }
+ }
+ else
+ {
+ WarningMsg << "WOKStep_LinkList::GetUnitLibrary"
+ << "Unit " << aunit->UserPathName() << " is not known to have a library" << endm;
+ }
+
+ return alib;
+}
+
+//=======================================================================
+//function : ComputeExternals
+//purpose :
+//=======================================================================
+void WOKStep_LinkList::ComputeExternals(const Handle(TCollection_HAsciiString)& aunit)
+{
+ WOKTools_MapOfHAsciiString amap;
+ Handle(TColStd_HSequenceOfHAsciiString) aseq;
+ Handle(TCollection_HAsciiString) externlib, astr;
+ Handle(WOKernel_File) afile;
+ Standard_Integer j;
+
+ externlib = new TCollection_HAsciiString("EXTERNLIB");
+
+ afile = Locator()->Locate(aunit, externlib, externlib);
+
+ if(!afile.IsNull()) {
+ WOKUtils_AdmFile thefile(afile->Path());
+
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(afile->LocatorName(),
+ afile,
+ new WOKBuilder_Miscellaneous(afile->Path()),
+ afile->Path());
+
+ infile->SetDirectFlag(Standard_False);
+ infile->SetLocateFlag(Standard_True);
+
+ aseq = thefile.Read();
+
+ for(j=1; j<=aseq->Length(); j++) {
+ astr = aseq->Value(j);
+
+ if(!amap.Contains(astr))
+ {
+ amap.Add(astr);
+
+ Handle(TCollection_HAsciiString) extid = new TCollection_HAsciiString(Unit()->Name());
+ extid->AssignCat(":external:");
+ extid->AssignCat(astr);
+
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(extid,
+ Handle(WOKernel_File)(),
+ Handle(WOKBuilder_Entity)(),
+ Handle(WOKUtils_Path)());
+ outfile->SetPhysicFlag(Standard_False);
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetReference();
+ outfile->SetExtern();
+ outfile->SetStepID(Standard_False);
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+ }
+ return;
+}
+
+
+
+//=======================================================================
+//function : GetUnitContributionCodes
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_LinkList::GetUnitContributionCodes(const Handle(WOKernel_DevUnit)& aunit) const
+{
+ Handle(TCollection_HAsciiString) atype = Unit()->Type();
+ Handle(TCollection_HAsciiString) paramname = new TCollection_HAsciiString("%WOKSteps_");
+
+ paramname->AssignCat(Unit()->Type());
+ paramname->AssignCat("_LinksWith");
+
+ Handle(TCollection_HAsciiString) codes = aunit->Params().Eval(paramname->ToCString());
+
+ if(codes.IsNull())
+ {
+ WarningMsg << "WOKStep_LinkList::GetUnitContributionCodes"
+ << "Could not eval parameter " << paramname << " in unit " << aunit->UserPathName() << endm;
+ }
+ return codes;
+}
+
+//=======================================================================
+//function : AddWorkbenchUnitContribution
+//purpose :
+//=======================================================================
+void WOKStep_LinkList::AddWorkbenchUnitContribution(const Handle(WOKMake_InputFile)& theinfile,
+ const Handle(TCollection_HAsciiString)& unit)
+{
+ Standard_Boolean failed = Standard_False;
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(unit);
+
+ if(!aunit.IsNull() && !theinfile.IsNull())
+ {
+ Handle(TCollection_HAsciiString) codes = GetUnitContributionCodes(aunit);
+
+ if(codes.IsNull())
+ {
+ WarningMsg << "WOKStep_LinkList::GetUnitContribution"
+ << "Could not eval contribution of unit : " << aunit->UserPathName() << " in link of " << Unit()->UserPathName() << endm;
+ }
+ else
+ {
+ Standard_Integer k=1;
+ Handle(TCollection_HAsciiString) code = codes->Token(" \t", k);
+
+ while(!code->IsEmpty())
+ {
+ Handle(WOKMake_Step) step = BuildProcess()->GetAndAddStep(aunit, code, Handle(TCollection_HAsciiString)());
+
+ if(!step.IsNull())
+ {
+ InfoMsg << "WOKStep_LinkList::GetUnitContribution"
+ << "Processing step " << step->UniqueName() << endm;
+
+
+ Handle(WOKMake_HSequenceOfOutputFile) outfiles = step->OutputFileList();
+
+ if(outfiles.IsNull())
+ {
+ ErrorMsg << "WOKStep_LinkList::GetUnitContribution"
+ << "Could not obtain output list of step : " << code << " in unit " << aunit->UserPathName() << endm;
+ failed = Standard_True;
+ }
+ else
+ {
+ Standard_Integer j;
+
+
+ for(j=1; j<=outfiles->Length(); j++)
+ {
+ Handle(WOKMake_OutputFile) outfile = outfiles->Value(j);
+ Standard_Boolean add = Standard_False;
+
+ if(!outfile->File().IsNull())
+ {
+ Handle(WOKUtils_Path) apath = outfile->File()->Path();
+ switch(apath->Extension())
+ {
+ case WOKUtils_ObjectFile: add = Standard_True;break;
+#ifndef WNT
+ case WOKUtils_ArchiveFile: add = Standard_True;break;
+ case WOKUtils_DSOFile: add = Standard_True;break;
+#else
+ case WOKUtils_IMPFile: add = Standard_True;break;
+ case WOKUtils_RESFile:
+ case WOKUtils_LIBFile: add = Standard_True;break;
+#endif // WNT
+ default:
+ break;
+ }
+
+
+ if(!strcmp(".ImplDep", outfile->File()->Path()->ExtensionName()->ToCString()))
+ {
+ add = Standard_True;
+ }
+
+ // }
+ if(add)
+ {
+ outfile->SetReference();
+ outfile->SetExtern();
+ outfile->SetLocateFlag(Standard_True);
+ AddExecDepItem(theinfile, outfile, Standard_True);
+ }
+ }
+ }
+ }
+ }
+ else
+ {
+ WarningMsg << "WOKStep_ComputeLinkList"
+ << "Ignoring invalid step code " << code << " in unit " << aunit->UserPathName() << endm;
+ }
+ k++;
+ code = codes->Token(" \t", k);
+ }
+ }
+ }
+ return;
+}
+
+//=======================================================================
+//function : AddParcelUnitContribution
+//purpose :
+//=======================================================================
+void WOKStep_LinkList::AddParcelUnitContribution(const Handle(WOKMake_InputFile)& theinfile,
+ const Handle(TCollection_HAsciiString)& unit)
+{
+
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(unit);
+
+ Handle(TCollection_HAsciiString) libtype = new TCollection_HAsciiString("library");
+
+#ifndef WNT
+ Handle(TCollection_HAsciiString) libname = WOKBuilder_SharedLibrary::GetLibFileName(Unit()->Params(), aunit->Name());
+#else
+ Handle(TCollection_HAsciiString) libname = WOKBuilder_ImportLibrary::GetLibFileName(Unit()->Params(), aunit->Name());
+#endif //WNT
+
+ Handle(WOKernel_File) lib = Locator()->Locate(aunit->Name(), libtype, libname);
+
+ if(!lib.IsNull())
+ {
+#ifndef WNT
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(lib->LocatorName(), lib,
+ new WOKBuilder_SharedLibrary(lib->Path()),
+ lib->Path());
+#else
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(lib->LocatorName(), lib,
+ new WOKBuilder_ImportLibrary(lib->Path()),
+ lib->Path());
+#endif //WNT
+ outfile->SetReference();
+ outfile->SetExtern();
+ outfile->SetLocateFlag(Standard_True);
+ AddExecDepItem(theinfile, outfile, Standard_True);
+ }
+
+ return;
+}
+
+
+
+//=======================================================================
+//function : AddUnitContribution
+//purpose :
+//=======================================================================
+void WOKStep_LinkList::AddUnitContribution(const Handle(WOKMake_InputFile)& theinfile,
+ const Handle(TCollection_HAsciiString)& unit)
+{
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(unit);
+
+ if(!aunit.IsNull() && !theinfile.IsNull())
+ {
+ const Handle(WOKernel_UnitNesting)& nest = aunit->Session()->GetUnitNesting(aunit->Nesting());
+
+ if(nest->IsKind(STANDARD_TYPE(WOKernel_Workbench)))
+ {
+ AddWorkbenchUnitContribution(theinfile, unit);
+ }
+ else
+ {
+ AddParcelUnitContribution(theinfile, unit);
+ }
+ }
+}
+
--- /dev/null
+-- File: WOKStep_MSFill.cdl
+-- Created: Thu Jun 27 17:18:26 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class MSFill from WOKStep
+inherits MSStep from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable MSFill from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ OutOfDateEntities(me:mutable)
+ ---Purpose: Set Build flag to OutOfDate entities
+ -- Clears Build flag to Uptodate Entities
+ -- This base implementation does nothing
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end MSFill;
--- /dev/null
+// File: WOKStep_MSFill.cxx
+// Created: Tue Aug 29 21:41:16 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#ifndef DONT_COMPENSATE
+
+#include <stdio.h>
+#include <unistd.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <time.h>
+
+#include <iostream.h>
+
+#endif
+
+#include <WOKTools_Messages.hxx>
+#include <WOKUtils_Path.hxx>
+
+#include <MS_MetaSchema.hxx>
+#include <MS_Engine.hxx>
+
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_CDLFile.hxx>
+#include <WOKBuilder_MSTranslator.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_MSAction.hxx>
+#include <WOKBuilder_MSTranslatorIterator.hxx>
+#include <WOKBuilder_MSchema.hxx>
+
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_MSFill.ixx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+# include <windows.h>
+# define sleep( nSec ) Sleep ( 1000 * ( nSec ) )
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_MSFill
+//purpose :
+//=======================================================================
+ WOKStep_MSFill::WOKStep_MSFill(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_MSStep(abp,aunit, acode, checked, hidden)
+{
+
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_MSFill::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)ADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_MSFill::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)TMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_MSFill::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ if(infile->File()->Path()->Extension() == WOKUtils_CDLFile)
+ {
+ infile->SetBuilderEntity(new WOKBuilder_CDLFile(infile->File()->Path()));
+ infile->SetDirectFlag(Standard_True);
+ infile->SetLocateFlag(Standard_True);
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_MSFill::OutOfDateEntities()
+{
+ return ForceBuild();
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_MSFill::Execute(const Handle(WOKMake_HSequenceOfInputFile)& )
+{
+ Handle(WOKBuilder_MSTranslator) acdlt = new WOKBuilder_MSTranslator(new TCollection_HAsciiString("CDLTranslate"), Unit()->Params());
+ Handle(WOKBuilder_MSchema) ams = WOKBuilder_MSTool::GetMSchema();
+ Handle(WOKBuilder_Specification) aspec;
+ Handle(WOKernel_Workbench) abench = Unit()->Session()->GetWorkbench(Unit()->Nesting());
+ Handle(WOKernel_File) acdlfile, gefile;
+ Handle(TCollection_HAsciiString) astr;
+ Handle(TCollection_HAsciiString) aunitname;
+ Handle(TCollection_HAsciiString) sourcetype = new TCollection_HAsciiString("source");
+ Handle(TColStd_HSequenceOfHAsciiString) aseq;
+ Standard_Integer i;
+ Standard_Boolean stop = Standard_False;
+
+#ifndef DONT_COMPENSATE
+
+ {
+ Handle(WOKernel_File) srcdir = new WOKernel_File(new TCollection_HAsciiString("testdate.temoin"),
+ Unit(), Unit()->GetFileType("source"));
+
+ srcdir->GetPath();
+
+ Standard_CString tempath = srcdir->Path()->Name()->ToCString();
+ Standard_Integer fd;
+
+#ifndef WNT
+ if((fd=open(tempath, O_WRONLY | O_CREAT | O_TRUNC)) == -1)
+#else
+ if((fd=open(tempath, O_WRONLY | O_CREAT | O_TRUNC, _S_IREAD | _S_IWRITE)) == -1)
+#endif // WNT
+ {
+ //SetFailed();
+ }
+ else
+ {
+ close(fd);
+ }
+
+ if(fd!=-1)
+ {
+ struct stat buf;
+
+ if(stat(tempath, &buf))
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Could not stat : " << tempath << endm;
+ //SetFailed();
+ }
+
+ time_t curdate ;
+
+ curdate = time(NULL);
+ if(curdate == -1)
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Could not obtain current date" << endm;
+ }
+
+ unlink(tempath);
+
+ Standard_Integer decal = buf.st_mtime - curdate;
+
+ if(decal < 0)
+ {
+ WarningMsg << "WOKStep_MSFill::Execute"
+ << "Cannot compensate negative (" << decal << "s) time displace" << endm;
+ }
+ else if(decal > 0)
+ {
+ WarningMsg << "WOKStep_MSFill::Execute"
+ << "Trying compensate positive (" << decal << "s) time displace" << endm;
+ sleep(decal);
+ }
+ }
+ }
+
+#endif
+
+ acdlt->Load();
+
+ acdlt->SetMSchema(WOKBuilder_MSTool::GetMSchema());
+
+ gefile = Locator()->Locate(Unit()->Name(), sourcetype, ams->AssociatedFile(Unit()->Name()));
+
+ if(gefile.IsNull())
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute" << "Missing file : " << ams->AssociatedFile(Unit()->Name()) << endm;
+ SetFailed();
+ return;
+ }
+
+
+ WOKBuilder_MSTranslatorIterator& anit = BuildProcess()->TranslatorIterator();
+ Handle(WOKBuilder_MSEntity) theentity;
+
+ if(WOKernel_IsPackage(Unit()))
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_Package);
+ }
+ else if(WOKernel_IsSchema(Unit()))
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_Schema);
+ }
+ else if(WOKernel_IsInterface(Unit()))
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_Interface);
+ }
+ else if(WOKernel_IsClient(Unit()))
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_Client);
+ }
+ else if(WOKernel_IsEngine(Unit()))
+ {
+ anit.AddInStack(Unit()->Name(), WOKBuilder_Engine);
+ }
+
+
+ while(anit.More() && !stop)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKBuilder_MSAction) anaction = anit.Value();
+
+ astr = ams->AssociatedFile(anaction->Entity()->Name());
+ aunitname = ams->AssociatedEntity(anaction->Entity()->Name());
+
+ acdlfile = Locator()->Locate(aunitname, new TCollection_HAsciiString("source"), astr);
+
+ if(!acdlfile.IsNull())
+ {
+ aspec = new WOKBuilder_CDLFile(acdlfile->Path());
+
+ switch(anit.Execute(acdlt, anaction, aspec))
+ {
+ case WOKBuilder_Unbuilt:
+ case WOKBuilder_Success:
+ break;
+ case WOKBuilder_Failed:
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Errors occured while executing " << anaction->Entity()->Name() << endm;
+ anit.Reset();
+ stop = Standard_True;
+ break;
+ }
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "No file " << astr << " in " << aunitname << endm;
+ stop = Standard_True;
+ }
+
+ anit.Next();
+ }
+
+ if(!stop)
+ {
+ Handle(WOKBuilder_MSchema) ams = WOKBuilder_MSTool::GetMSchema();
+
+ if(!ams->MetaSchema()->Check(Unit()->Name()))
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Check of " << Unit()->Name() << " has failed" << endm;
+ stop = Standard_True;
+ }
+ else
+ {
+ InfoMsg << "WOKStep_MSFill::Execute"
+ << "Check of " << Unit()->Name() << " succeeded" << endm;
+ }
+ }
+
+ if(!stop)
+ {
+ Handle(TCollection_HAsciiString) msid;
+ static Handle(TCollection_HAsciiString) msentity = new TCollection_HAsciiString("msentity");
+ Handle(WOKernel_File) origin;
+ Handle(WOKBuilder_MSchema) ameta = WOKBuilder_MSTool::GetMSchema();
+ Standard_Integer j;
+
+ aseq = WOKBuilder_MSTool::GetMSchema()->GetEntityTypes(Unit()->Name());
+
+ for(i=1; i<=aseq->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ origin = Locator()->Locate(Unit()->Name(), sourcetype,
+ WOKBuilder_MSTool::GetMSchema()->AssociatedFile(aseq->Value(i)));
+
+ Handle(WOKMake_InputFile) infile;
+
+ if(myinflow.Contains(origin->LocatorName()))
+ {
+ infile = myinflow.FindFromKey(origin->LocatorName());
+ }
+
+ if(infile.IsNull())
+ {
+ WarningMsg << "WOKStep_MSFill::Execute" << origin->LocatorName() << " is not an input of this step" << endm;
+ WarningMsg << "WOKStep_MSFill::Execute" << "Perhaps performing step (src) is needed" << endm;
+ }
+ else
+ {
+ Handle(WOKernel_File) NULLFILE;
+ Handle(WOKUtils_Path) NULLPATH;
+ msid = WOKernel_File::FileLocatorName(Unit()->Name(), msentity, aseq->Value(i));
+
+
+ Handle(WOKBuilder_Specification) specfile = Handle(WOKBuilder_Specification)::DownCast(infile->BuilderEntity());
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(msid, NULLFILE,
+ new WOKBuilder_MSEntity(specfile, aseq->Value(i)),
+ NULLPATH);
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ outfile->SetPhysicFlag(Standard_False);
+ AddExecDepItem(infile, outfile, Standard_True);
+
+ // Traitement du schema
+ Handle(MS_Exec) exec;
+ if(ameta->MetaSchema()->IsExecutable(Unit()->Name())) exec = ameta->MetaSchema()->GetExecutable(Unit()->Name());
+ if(ameta->MetaSchema()->IsEngine(Unit()->Name())) exec = ameta->MetaSchema()->GetEngine(Unit()->Name());
+
+
+ if(!exec.IsNull())
+ {
+ Handle(TCollection_HAsciiString) asch = exec->Schema();
+ if(!asch.IsNull())
+ {
+ Handle(WOKernel_File) NULLFILE;
+ Handle(WOKUtils_Path) NULLPATH;
+ msid = WOKernel_File::FileLocatorName(Unit()->Name(), msentity, asch);
+
+ Handle(WOKBuilder_Specification) specfile = Handle(WOKBuilder_Specification)::DownCast(infile->BuilderEntity());
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(msid, NULLFILE,
+ new WOKBuilder_MSEntity(asch),
+ NULLPATH);
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetReference();
+ outfile->SetPhysicFlag(Standard_False);
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ }
+
+ // Traitement des Interfaces
+ if(ameta->MetaSchema()->IsEngine(Unit()->Name()))
+ {
+ Handle(MS_Engine) engine = ameta->MetaSchema()->GetEngine(Unit()->Name());
+ Handle(TColStd_HSequenceOfHAsciiString) ints = engine->Interfaces();
+
+ for(j=1; j<=ints->Length(); j++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(ints->Value(j));
+
+ if(!aunit.IsNull())
+ {
+ if(WOKernel_IsInterface(aunit))
+ {
+ Handle(WOKernel_File) NULLFILE;
+ Handle(WOKUtils_Path) NULLPATH;
+ msid = WOKernel_File::FileLocatorName(Unit()->Name(), msentity, ints->Value(j));
+
+ Handle(WOKBuilder_Specification) specfile = Handle(WOKBuilder_Specification)::DownCast(infile->BuilderEntity());
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(msid, NULLFILE,
+ new WOKBuilder_MSEntity(aunit->Name()),
+ NULLPATH);
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetReference();
+ outfile->SetPhysicFlag(Standard_False);
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Unit : " << aunit->Name() << " should be an interface and is not" << endm;
+ stop = Standard_True;
+ }
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Unit : " << ints->Value(i) << " could not be located" << endm;
+ stop = Standard_True;
+ }
+ }
+
+
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(new TCollection_HAsciiString("EngineInterface"));
+
+ if(!aunit.IsNull())
+ {
+ if(WOKernel_IsInterface(aunit))
+ {
+ Handle(WOKernel_File) NULLFILE;
+ Handle(WOKUtils_Path) NULLPATH;
+ msid = WOKernel_File::FileLocatorName(Unit()->Name(), msentity, aunit->Name());
+
+ Handle(WOKBuilder_Specification) specfile = Handle(WOKBuilder_Specification)::DownCast(infile->BuilderEntity());
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(msid, NULLFILE,
+ new WOKBuilder_MSEntity(aunit->Name()),
+ NULLPATH);
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetReference();
+ outfile->SetPhysicFlag(Standard_False);
+ AddExecDepItem(infile, outfile, Standard_True);
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Unit : " << aunit->Name() << " should be an interface and is not" << endm;
+ stop = Standard_True;
+ }
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_MSFill::Execute"
+ << "Unit : EngineInterface could not be located" << endm;
+ stop = Standard_True;
+ }
+ }
+ }
+ }
+ }
+
+ if(stop)
+ SetFailed();
+ else
+ SetSucceeded();
+}
--- /dev/null
+-- File: WOKStep_MSStep.cdl
+-- Created: Thu Jun 27 17:17:55 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+deferred class MSStep from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ File from WOKernel,
+ Entity from WOKBuilder,
+ HAsciiString from TCollection
+
+is
+
+ Initialize(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard);
+
+ BuilderEntity(me; akernelent : File from WOKernel)
+ returns mutable Entity from WOKBuilder
+ is redefined protected;
+ ---Purpose: Adds an entity to the known entity list
+ -- (one more time)
+
+end MSStep;
--- /dev/null
+// File: WOKStep_MSStep.cxx
+// Created: Tue Nov 14 19:16:15 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKernel_FileTypeBase.hxx>
+
+#include <WOKBuilder_MSEntity.hxx>
+
+
+#include <WOKMake_InputFile.hxx>
+
+#include <WOKStep_MSStep.ixx>
+
+//=======================================================================
+//function : WOKStep_MSStep
+//purpose :
+//=======================================================================
+ WOKStep_MSStep::WOKStep_MSStep(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp,aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : BuilderEntity
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_Entity) WOKStep_MSStep::BuilderEntity(const Handle(WOKernel_File)& infile) const
+{
+ Handle(WOKBuilder_Entity) entity;
+
+ if(myinflow.Contains(infile->LocatorName()))
+ {
+ entity = myinflow.FindFromKey(infile->LocatorName())->BuilderEntity();
+ if(!entity.IsNull()) return entity;
+ }
+ if(!strcmp(infile->TypeName()->ToCString(),"msentity"))
+ {
+ entity = new WOKBuilder_MSEntity(infile->Name());
+ entity->SetPath(infile->Path());
+ return entity;
+ }
+ return entity;
+}
+
--- /dev/null
+-- File: WOKStep_ProcessStep.cdl
+-- Created: Mon Aug 18 15:12:05 1997
+-- Author: Jean GAUTIER
+-- <jga@hourax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+
+deferred class ProcessStep from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ Path from WOKUtils,
+ HAsciiString from TCollection,
+ MapOfHAsciiString from WOKTools,
+ DataMapOfHAsciiStringOfFile from WOKernel,
+ IndexedDataMapOfHAsciiStringOfInputFile from WOKMake
+is
+
+ Initialize(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard);
+
+ Init(me:mutable)
+ is redefined protected;
+
+
+ ImplDepFileName(me)
+ returns HAsciiString from TCollection
+ is virtual protected;
+
+ GetUnitName(me:mutable; aincfile : HAsciiString from TCollection)
+ returns HAsciiString from TCollection
+ is protected;
+
+ GetKnownUnits(me:mutable)
+ is protected;
+
+ GetInputFileFromPath(me:mutable; apath : HAsciiString from TCollection)
+ ---C++: return const &
+ returns InputFile from WOKMake
+ is protected;
+
+ TreatOutput(me:mutable; input : InputFile from WOKMake;
+ output : HSequenceOfEntity from WOKBuilder);
+
+ ComputeIncDirectories(me)
+ returns HSequenceOfPath from WOKUtils is protected;
+
+ ComputeDatabaseDirectories(me)
+ returns HSequenceOfPath from WOKUtils is protected;
+
+
+end ProcessStep;
--- /dev/null
+// File: WOKStep_ProcessStep.cxx
+// Created: Mon Aug 18 15:41:22 1997
+// Author: Jean GAUTIER
+// <jga@hourax.paris1.matra-dtv.fr>
+
+
+
+#include <unistd.h>
+#include <fstream.h>
+
+#include <TCollection_HAsciiString.hxx>
+
+#include <TColStd_HArray2OfInteger.hxx>
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Param.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#ifndef WNT
+# include <WOKUtils_RemoteShell.hxx>
+#else
+# include <WOKUtils_Shell.hxx>
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+#include <WOKernel_Locator.hxx>
+
+
+#include <WOKBuilder_HSequenceOfToolInShell.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_Entity.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfStepOption.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+
+#include <WOKStep_ProcessStep.ixx>
+
+#define READBUF_SIZE 1024
+
+#ifndef WNT
+#define CHECK_REMOTE 1
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_ProcessStep
+//purpose :
+//=======================================================================
+WOKStep_ProcessStep::WOKStep_ProcessStep(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKMake_Step(abp,aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : Init
+//purpose :
+//=======================================================================
+void WOKStep_ProcessStep::Init()
+{
+ BuildProcess()->GetKnownUnits();
+}
+
+
+//=======================================================================
+//function : MFileName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ProcessStep::ImplDepFileName() const
+{
+ // le MyUd.MakeState
+ Handle(TCollection_HAsciiString) aname = new TCollection_HAsciiString(Unit()->Name());
+ if(!SubCode().IsNull())
+ {
+ aname->AssignCat("_");
+ aname->AssignCat(SubCode());
+ }
+ aname->AssignCat(".");
+ aname->AssignCat(Unit()->Params().Eval("%FILENAME_MAKESTATE"));
+ return aname;
+}
+
+//=======================================================================
+//function : GetUnitName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_ProcessStep::GetUnitName(const Handle(TCollection_HAsciiString)& aincpath)
+{
+ WOKTools_MapOfHAsciiString& knownunits = BuildProcess()->KnownUnits();
+
+ Handle(TCollection_HAsciiString) handleprefix = Unit()->Params().Eval("%FILENAME_HANDLEPREFIX");
+ Handle(TCollection_HAsciiString) rejectlist = Unit()->Params().Eval("%FILENAME_REJECTLIST");
+ Handle(TCollection_HAsciiString) unitname;
+ Standard_CString ptr;
+ static Standard_CString unit = new char[1024];
+ Standard_CString unitptr;
+ Standard_Integer apos;
+
+ unitptr = unit;
+ *unitptr = '\0';
+
+ Handle(WOKUtils_Path) apath = new WOKUtils_Path(aincpath);
+ Handle(TCollection_HAsciiString) basename = new TCollection_HAsciiString("|");
+ basename->AssignCat(apath->FileName());
+ basename->AssignCat("|");
+
+
+ if(rejectlist->Search(basename) != -1)
+ {
+ WOK_TRACE {
+ VerboseMsg("WOK_IDEP") << "WOKStep_ProcessStep::GetUnitName"
+ << "Rejected include : " << aincpath << endm;
+ }
+ return unitname;
+ }
+
+ // Extraire le BaseName
+ if((apos = aincpath->SearchFromEnd("/")) != -1)
+ {
+ ptr = aincpath->ToCString() + apos;
+ }
+ else
+ {
+ ptr = aincpath->ToCString();
+ }
+
+
+ // Supprimer Handle_
+ if(!strncmp(ptr, handleprefix->ToCString(), handleprefix->Length()))
+ {
+ // Handle_*****
+ ptr += handleprefix->Length();
+ }
+
+ // A partir d'ici : Tout est Ud
+ while(*ptr)
+ {
+ if(IsAlphanumeric(*ptr))
+ {
+ *unitptr = *ptr;
+ unitptr++;
+ }
+ else
+ {
+ break;
+ }
+ *ptr++;
+ }
+
+ *unitptr = '\0';
+
+ unitname = new TCollection_HAsciiString(unit);
+
+ if(!knownunits.Contains(unitname))
+ {
+ unitname.Nullify();
+ }
+ return unitname;
+}
+
+
+//=======================================================================
+//function : GetInputFileFromPath
+//purpose :
+//=======================================================================
+const Handle(WOKMake_InputFile)& WOKStep_ProcessStep::GetInputFileFromPath(const Handle(TCollection_HAsciiString)& thepath)
+{
+ static Handle(WOKMake_InputFile) NULLRESULT;
+ WOKMake_IndexedDataMapOfHAsciiStringOfInputFile& makestate = BuildProcess()->MakeState();
+
+ if(makestate.Contains(thepath)) return makestate.FindFromKey(thepath);
+ else
+ {
+ Handle(TCollection_HAsciiString) pubinclude = new TCollection_HAsciiString("pubinclude");
+ Handle(TCollection_HAsciiString) privinclude = new TCollection_HAsciiString("privinclude");
+ Handle(TCollection_HAsciiString) source = new TCollection_HAsciiString("source");
+ Handle(TCollection_HAsciiString) aunitname, abasename;
+ Handle(WOKernel_File) incfile;
+
+ Handle(WOKMake_InputFile) result;
+ aunitname = GetUnitName(thepath);
+
+ if(!aunitname.IsNull())
+ {
+ // unitname was found: Include Cas.Cade
+ Handle(WOKUtils_Path) apath = new WOKUtils_Path(thepath);
+ abasename = apath->FileName();
+ if(aunitname->IsSameString(Unit()->Name()))
+ {
+ // l'include appartient a l'ud en cours : determiner son type
+
+ if((incfile = Locator()->Locate(Unit()->Name(), pubinclude, abasename)).IsNull())
+ {
+ if((incfile = Locator()->Locate(Unit()->Name(), privinclude, abasename)).IsNull())
+ {
+ incfile = Locator()->Locate(Unit()->Name(), source, abasename);
+ }
+ }
+ }
+ else
+ {
+ incfile = Locator()->Locate(aunitname, pubinclude, abasename);
+ }
+
+ if(!incfile.IsNull())
+ {
+ result = new WOKMake_InputFile(incfile->LocatorName(), incfile, Handle(WOKBuilder_Entity)(), incfile->Path());
+
+ result->SetLocateFlag(Standard_True);
+ result->SetDirectFlag(Standard_False);
+
+ makestate.Add(thepath, result);
+
+ return makestate(makestate.Extent());
+ }
+ }
+
+ if(result.IsNull())
+ {
+ result = new WOKMake_InputFile(thepath,
+ Handle(WOKernel_File)(), Handle(WOKBuilder_Entity)(),
+ new WOKUtils_Path(thepath));
+ result->SetLocateFlag(Standard_False);
+ result->SetDirectFlag(Standard_False);
+
+ makestate.Add(thepath, result);
+
+ return makestate(makestate.Extent());
+
+ }
+ }
+ return NULLRESULT;
+}
+
+//=======================================================================
+//function : TreatOutput
+//purpose :
+//=======================================================================
+void WOKStep_ProcessStep::TreatOutput(const Handle(WOKMake_InputFile)& infile, const Handle(WOKBuilder_HSequenceOfEntity)& output)
+{
+ char buffer[READBUF_SIZE];
+
+ Handle(WOKernel_FileType) srctype = Unit()->FileTypeBase()->Type("source");
+ Handle(WOKernel_FileType) inctype = Unit()->FileTypeBase()->Type("pubinclude");
+ Handle(WOKernel_FileType) drvtype = Unit()->FileTypeBase()->Type("derivated");
+ Handle(WOKernel_FileType) objtype = Unit()->FileTypeBase()->Type("object");
+ WOKMake_IndexedDataMapOfHAsciiStringOfOutputFile outmap;
+ Handle(WOKBuilder_Entity) MFILE;
+
+ for(Standard_Integer i=1; i<=output->Length(); i++)
+ {
+ Handle(WOKBuilder_Entity) outent = output->Value(i);
+ Handle(WOKernel_File) aoutfile;
+ Standard_Boolean istemplate = Standard_False;
+
+ WOKUtils_Extension extens = outent->Path()->Extension();
+
+ switch(extens)
+ {
+ case WOKUtils_TemplateFile:
+ aoutfile = new WOKernel_File(outent->Path()->FileName(), Unit(), srctype);
+ istemplate = Standard_True;
+ break;
+ case WOKUtils_CXXFile:
+ aoutfile = new WOKernel_File(outent->Path()->FileName(), Unit(), drvtype);
+ break;
+ case WOKUtils_HXXFile:
+ aoutfile = new WOKernel_File(outent->Path()->FileName(), Unit(), inctype);
+ break;
+ case WOKUtils_ObjectFile:
+ aoutfile = new WOKernel_File(outent->Path()->FileName(), Unit(), objtype);
+ break;
+ case WOKUtils_MFile:
+ // MFiles are no longer output of steps
+ MFILE = outent;
+ break;
+ default:
+ break;
+ }
+
+ if(aoutfile.IsNull() && extens != WOKUtils_MFile)
+ {
+ ErrorMsg << "WOKStep_ProcessStep::Execute"
+ << "Unrecognized file : " << outent->Path()->Name() << endm;
+ }
+ if(!aoutfile.IsNull())
+ {
+ if(!outmap.Contains(aoutfile->LocatorName()))
+ {
+ Handle(WOKMake_OutputFile) outfile;
+ // je calcule le path de destination du file
+ aoutfile->GetPath();
+
+ // je l'y deplace
+ outent->Path()->MoveTo(aoutfile->Path());
+
+ if(!istemplate)
+ {
+ outfile = new WOKMake_OutputFile(aoutfile->LocatorName(), aoutfile, outent, aoutfile->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+
+ AddExecDepItem(infile, outfile, Standard_True);
+ outmap.Add(aoutfile->LocatorName(), outfile);
+ }
+ else
+ {
+ outfile = new WOKMake_OutputFile(aoutfile->LocatorName(), aoutfile, outent, aoutfile->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetReference();
+
+ AddExecDepItem(infile, outfile, Standard_True);
+ outmap.Add(aoutfile->LocatorName(), outfile);
+ }
+ }
+ }
+ }
+
+ if(!output.IsNull() && !MFILE.IsNull())
+ {
+ ifstream mfile(MFILE->Path()->Name()->ToCString());
+
+ while(mfile >> setw(READBUF_SIZE) >> buffer)
+ {
+ if(*buffer != '\0')
+ {
+ Handle(TCollection_HAsciiString) thefile = new TCollection_HAsciiString(buffer);
+
+ const Handle(WOKMake_InputFile)& infile = GetInputFileFromPath(thefile);
+
+ for(Standard_Integer i=1; i<=outmap.Extent(); i++)
+ {
+ AddExecDepItem(infile, outmap(i), Standard_False);
+ }
+ }
+ }
+ mfile.close();
+ MFILE->Path()->RemoveFile();
+ }
+}
+
+//=======================================================================
+//function : ComputeIncDirectories
+//purpose :
+//=======================================================================
+Handle(WOKUtils_HSequenceOfPath) WOKStep_ProcessStep::ComputeIncDirectories() const
+{
+ Handle(TColStd_HSequenceOfHAsciiString) nestingseq = Unit()->Session()->GetWorkbench(Unit()->Nesting())->Visibility();
+ Handle(TCollection_HAsciiString) aname;
+ Handle(WOKUtils_HSequenceOfPath) aseq = new WOKUtils_HSequenceOfPath;
+ Handle(WOKernel_File) afile;
+ Handle(WOKernel_FileType) atype;
+ Handle(WOKernel_DevUnit) aunit;
+ Handle(TCollection_HAsciiString) DOT = new TCollection_HAsciiString(".");
+ WOKTools_MapOfHAsciiString amap;
+ Standard_Integer i;
+ Standard_Boolean usesrcdir = Standard_False;
+
+ if(!Unit()->Params().Eval("%WOKSteps_UseSourceInclude").IsNull())
+ {
+ usesrcdir = Standard_True;
+ }
+
+ for(i=1; i<=nestingseq->Length(); i++)
+ {
+ Handle(WOKernel_UnitNesting) nesting = Unit()->Session()->GetUnitNesting(nestingseq->Value(i));
+ //nesting de la visibilite
+ atype = nesting->FileTypeBase()->Type("pubincdir");
+ afile = new WOKernel_File(DOT, nesting, atype);
+ afile->GetPath();
+ if(!amap.Contains(afile->Path()->Name()))
+ {
+ aseq->Append(afile->Path());
+ amap.Add(afile->Path()->Name());
+ }
+
+ // l'ud est-elle dans ce nesting
+ aname = nesting->NestedUniqueName(Unit()->Name());
+ if(Unit()->Session()->IsKnownEntity(aname))
+ {
+ aunit = Unit()->Session()->GetDevUnit(aname);
+
+ Handle(WOKernel_UnitNesting) anesting = Unit()->Session()->GetUnitNesting(aunit->Nesting());
+ if(anesting->IsKind(STANDARD_TYPE(WOKernel_Workbench)))
+ {
+ atype = aunit->FileTypeBase()->Type("privinclude");
+ afile = new WOKernel_File(DOT, aunit, atype);
+ afile->GetPath();
+
+ if(!amap.Contains(afile->Path()->Name()))
+ {
+ aseq->Append(afile->Path());
+ amap.Add(afile->Path()->Name());
+ }
+
+ if(usesrcdir)
+ {
+ atype = aunit->FileTypeBase()->Type("userinclude");
+
+ afile = new WOKernel_File(DOT, aunit, atype);
+ afile->GetPath();
+
+ if(!amap.Contains(afile->Path()->Name()))
+ {
+ aseq->Append(afile->Path());
+ amap.Add(afile->Path()->Name());
+ }
+ }
+ }
+ }
+ }
+
+ return aseq;
+}
+
+//=======================================================================
+//function : ComputeDatabaseDirectories
+//purpose :
+//=======================================================================
+Handle(WOKUtils_HSequenceOfPath) WOKStep_ProcessStep::ComputeDatabaseDirectories() const
+{
+ Handle(WOKUtils_HSequenceOfPath) aseq;
+
+ if(Unit()->Params().Eval("%WOKSteps_UseDatabaseDirectory").IsNull())
+ {
+ return aseq;
+ }
+
+ Handle(TColStd_HSequenceOfHAsciiString) nestingseq = Unit()->Session()->GetWorkbench(Unit()->Nesting())->Visibility();
+ Handle(TCollection_HAsciiString) aname;
+ Handle(WOKernel_File) afile;
+ Handle(WOKernel_FileType) atype;
+ Handle(WOKernel_DevUnit) aunit;
+ Handle(TCollection_HAsciiString) DOT = new TCollection_HAsciiString(".");
+ WOKTools_MapOfHAsciiString amap;
+ Standard_Integer i;
+
+ aseq = new WOKUtils_HSequenceOfPath;
+
+ for(i=1; i<=nestingseq->Length(); i++)
+ {
+ Handle(WOKernel_UnitNesting) nesting = Unit()->Session()->GetUnitNesting(nestingseq->Value(i));
+ // les wbs uniquement
+ if(nesting->IsKind(STANDARD_TYPE(WOKernel_Workbench))) {
+ atype = nesting->FileTypeBase()->Type("libdir");
+ afile = new WOKernel_File(DOT, nesting, atype);
+ afile->GetPath();
+ if(!amap.Contains(afile->Path()->Name()))
+ {
+ aseq->Append(afile->Path());
+ amap.Add(afile->Path()->Name());
+ }
+ }
+ }
+
+ return aseq;
+}
--- /dev/null
+-- File: WOKStep_ResourceSource.cdl
+-- Created: Thu Sep 26 16:03:25 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+class ResourceSource from WOKStep
+inherits Source from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ InputFile from WOKMake,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ResourceSource from WOKStep;
+
+ ReadFILES(me:mutable; FILES : InputFile from WOKMake)
+ is redefined protected;
+
+end ResourceSource;
--- /dev/null
+// File: WOKStep_ResourceSource.cxx
+// Created: Thu Sep 26 16:05:39 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <WOKStep_ResourceSource.ixx>
+
+
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Param.hxx>
+#include <WOKTools_Messages.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <TCollection_HAsciiString.hxx>
+
+//=======================================================================
+//function : WOKStep_Source
+//purpose :
+//=======================================================================
+WOKStep_ResourceSource::WOKStep_ResourceSource(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden )
+ : WOKStep_Source(abp,aunit,acode,checked,hidden)
+{
+
+}
+
+//=======================================================================
+//function : ReadFILES
+//purpose :
+//=======================================================================
+void WOKStep_ResourceSource::ReadFILES(const Handle(WOKMake_InputFile)& FILES)
+{
+ Handle(WOKernel_File) afile;
+ Handle(TCollection_HAsciiString) sourcetype = new TCollection_HAsciiString("source");
+ Standard_Integer i;
+
+ // le fichier FILES
+ WOKUtils_Param params = Unit()->Params();
+
+ if(FILES.IsNull() == Standard_False)
+ {
+ // le fichier FILES produit FILES
+ Handle(WOKMake_OutputFile) OUTFILES = new WOKMake_OutputFile(FILES->File()->LocatorName(), FILES->File(),
+ Handle(WOKBuilder_Entity)(), FILES->File()->Path());
+
+ OUTFILES->SetProduction();
+ OUTFILES->SetLocateFlag(Standard_True);
+ AddExecDepItem(FILES, OUTFILES, Standard_True);
+
+ // un fichier FILES existe : le lire
+ WOKUtils_AdmFile afiles(FILES->File()->Path());
+ Handle(TColStd_HSequenceOfHAsciiString) aasciiseq;
+ Handle(TCollection_HAsciiString) astr;
+
+ aasciiseq = afiles.Read();
+
+ if(!aasciiseq.IsNull())
+ {
+ for(i=1; i<=aasciiseq->Length(); i++)
+ {
+ astr = aasciiseq->Value(i);
+
+ astr->LeftAdjust();
+ astr->RightAdjust();
+
+ Standard_Integer first = astr->Search(":::");
+
+ if (first <= 1)
+ {
+ Handle(TCollection_HAsciiString) filenameFILES = Unit()->Params().Eval("%FILENAME_FILES");
+ if (strcmp(filenameFILES->ToCString(),astr->ToCString()))
+ {
+ ErrorMsg << "WOKStep_ResourceSource::ReadFILES"
+ << "No type specified for file " << astr << endm;
+ SetFailed();
+ }
+ }
+ else
+ {
+ Handle(TCollection_HAsciiString) type = astr->SubString(1,first-1);
+ Handle(TCollection_HAsciiString) name = astr->SubString(first+3, astr->Length());
+
+ Handle(WOKernel_FileType) theType = Unit()->GetFileType(type);
+
+ if(!theType.IsNull())
+ {
+ if(theType->IsStationDependent() || theType->IsDBMSDependent())
+ {
+ WarningMsg << "WOKStep_ResourceSource::ReadFILES"
+ << "Station or DBMS Dependent type " << type << " : ignoring file " << name << endm;
+ }
+ else
+ {
+ afile = Locator()->Locate(Unit()->Name(), sourcetype, name);
+
+ if(afile.IsNull() == Standard_True)
+ {
+ ErrorMsg << "WOKStep_ResourceSource::ReadFILES"
+ << "File " << astr->ToCString() << " could not be found" << endm;
+ SetFailed();
+ }
+ else
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(afile->LocatorName(), afile,
+ Handle(WOKBuilder_Entity)(), afile->Path());
+ outfile->SetProduction();
+ outfile->SetLocateFlag(Standard_True);
+ AddExecDepItem(FILES, outfile, Standard_True);
+ }
+ }
+ }
+ else
+ {
+ ErrorMsg << "WOKStep_ResourceSource::ReadFILES"
+ << "Type unknown : " << type << " for file : " << name << endm;
+ SetFailed();
+ }
+ }
+ }
+ }
+ }
+ return;
+}
--- /dev/null
+-- File: WOKStep_ServerExtract.cdl
+-- Created: Thu Jun 27 17:21:01 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class ServerExtract from WOKStep
+inherits Extract from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ServerExtract from WOKStep;
+
+ OutOfDateEntities(me:mutable)
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+end ServerExtract;
--- /dev/null
+// File: WOKStep_ServerExtract.cxx
+// Created: Wed Jan 3 18:00:58 1996
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKBuilder_MSServerExtractor.hxx>
+#include <WOKBuilder_MSEntity.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKStep_ServerExtract.ixx>
+
+//=======================================================================
+//function : WOKStep_ServerExtract
+//purpose :
+//=======================================================================
+WOKStep_ServerExtract::WOKStep_ServerExtract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Extract(abp,aunit, acode, checked, hidden)
+{
+ Handle(WOKBuilder_MSServerExtractor) anextractor = new WOKBuilder_MSServerExtractor(Unit()->Params());
+
+ anextractor->SetMSchema(WOKBuilder_MSTool::GetMSchema());
+ SetExtractor(anextractor);
+}
+
+//=======================================================================
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_ServerExtract::OutOfDateEntities()
+{
+ return ForceBuild();
+}
+
+
--- /dev/null
+-- File: WOKStep_Source.cdl
+-- Created: Thu Jun 27 17:15:36 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class Source from WOKStep
+inherits Step from WOKMake
+
+ ---Purpose: Computes Source File List.
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ File from WOKernel,
+ HSequenceOfFile from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable Source from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; anitem : InputFile from WOKMake)
+ returns Boolean from Standard
+ is redefined protected;
+
+ GetFILES(me)
+ returns File from WOKernel
+ is protected;
+
+ ReadFILES(me:mutable; FILES : InputFile from WOKMake)
+ is virtual protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ ---Purpose: Executes step
+ -- Computes output files
+ is redefined private;
+
+
+end Source;
--- /dev/null
+// File: WOKStep_Source.cxx
+// Created: Tue Aug 29 21:41:43 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <WOKStep_Source.ixx>
+
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Param.hxx>
+#include <WOKTools_Messages.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <TCollection_HAsciiString.hxx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_Source
+//purpose :
+//=======================================================================
+WOKStep_Source::WOKStep_Source(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden )
+ : WOKMake_Step(abp,aunit,acode,checked,hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Source::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)TMPDIR);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_Source::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)ADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_Source::HandleInputFile(const Handle(WOKMake_InputFile)& afile)
+{
+ Handle(WOKernel_File) file = afile->File();
+
+ if(file.IsNull()) return Standard_False;
+
+ if(!strcmp(file->TypeName()->ToCString(), "source"))
+ {
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : GetFILES
+//purpose :
+//=======================================================================
+Handle(WOKernel_File) WOKStep_Source::GetFILES() const
+{
+ Handle(TCollection_HAsciiString) astr = Unit()->Params().Eval("%FILENAME_FILES");
+ Handle(TCollection_HAsciiString) asourcetype = new TCollection_HAsciiString("source");
+ Handle(WOKernel_File) afile = Locator()->Locate(Unit()->Name(), asourcetype, astr);
+ return afile;
+}
+
+
+//=======================================================================
+//function : ReadFILES
+//purpose :
+//=======================================================================
+void WOKStep_Source::ReadFILES(const Handle(WOKMake_InputFile)& FILES)
+{
+ Handle(WOKernel_File) afile;
+ Handle(TCollection_HAsciiString) sourcetype = new TCollection_HAsciiString("source");
+ Standard_Integer i;
+
+ // le fichier FILES
+ WOKUtils_Param params = Unit()->Params();
+
+ if(FILES.IsNull() == Standard_False)
+ {
+ // le fichier FILES produit FILES
+ Handle(WOKMake_OutputFile) OUTFILES = new WOKMake_OutputFile(FILES->File()->LocatorName(), FILES->File(),
+ Handle(WOKBuilder_Entity)(), FILES->File()->Path());
+
+ OUTFILES->SetProduction();
+ OUTFILES->SetLocateFlag(Standard_True);
+ AddExecDepItem(FILES, OUTFILES, Standard_True);
+
+ // un fichier FILES existe : le lire
+ WOKUtils_AdmFile afiles(FILES->File()->Path());
+ Handle(TColStd_HSequenceOfHAsciiString) aasciiseq;
+ Handle(TCollection_HAsciiString) astr;
+
+ aasciiseq = afiles.Read();
+
+ if(!aasciiseq.IsNull())
+ {
+ for(i=1; i<=aasciiseq->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ astr = aasciiseq->Value(i);
+
+ astr->LeftAdjust();
+ astr->RightAdjust();
+
+ afile = Locator()->Locate(Unit()->Name(), sourcetype, astr);
+
+ if(afile.IsNull() == Standard_True)
+ {
+ ErrorMsg << "WOKStep_Source::ReadFILES"
+ << "File " << astr->ToCString() << " could not be found" << endm;
+ SetFailed();
+ return;
+ }
+ else
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(afile->LocatorName(), afile,
+ Handle(WOKBuilder_Entity)(), afile->Path());
+ outfile->SetProduction();
+ outfile->SetLocateFlag(Standard_True);
+ AddExecDepItem(FILES, outfile, Standard_True);
+ }
+ }
+ }
+ }
+ return;
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_Source::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(WOKernel_File) FILES = GetFILES();
+ if(execlist->Length())
+ {
+ Standard_Integer i;
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ if(!strcmp(execlist->Value(i)->File()->Name()->ToCString(), FILES->Name()->ToCString()))
+ {
+ ReadFILES(execlist->Value(i));
+ }
+ }
+ }
+ else
+ {
+ if(!FILES.IsNull())
+ {
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(FILES->LocatorName(), FILES,
+ Handle(WOKBuilder_Entity)(), FILES->Path());
+ infile->SetLocateFlag(Standard_True);
+ infile->SetDirectFlag(Standard_True);
+ execlist->Append(infile);
+ ReadFILES(infile);
+ }
+ }
+
+ if (Status() != WOKMake_Failed)
+ SetSucceeded();
+
+ return;
+}
--- /dev/null
+-- File: WOKStep_SourceExtract.cdl
+-- Created: Thu Jun 27 17:21:38 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class SourceExtract from WOKStep
+inherits Extract from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable SourceExtract from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutOfDateEntities(me:mutable)
+ ---Purpose: Set Build flag to OutOfDate entities
+ -- Clears Build flag to Uptodate Entities
+ -- This base implementation does nothing
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end SourceExtract;
--- /dev/null
+// File: WOKStep_SourceExtract.cxx
+// Created: Thu Nov 16 11:23:48 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_Path.hxx>
+
+#include <WOKBuilder_MSEntity.hxx>
+#include <WOKBuilder_MSTool.hxx>
+#include <WOKBuilder_MSchema.hxx>
+
+#include <WOKernel_FileTypeBase.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_HSequenceOfFile.hxx>
+#include <WOKernel_Locator.hxx>
+
+
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_SourceExtract.ixx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_SourceExtract
+//purpose :
+//=======================================================================
+WOKStep_SourceExtract::WOKStep_SourceExtract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Extract(abp,aunit,acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_SourceExtract::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)ADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_SourceExtract::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)TMPDIR);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_SourceExtract::OutOfDateEntities()
+{
+ return ForceBuild();
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_SourceExtract::Execute(const Handle(WOKMake_HSequenceOfInputFile)& tobuild)
+{
+ Standard_Integer i,j;
+ Handle(TColStd_HSequenceOfHAsciiString) aseq;
+ Handle(TCollection_HAsciiString) sourcetype = new TCollection_HAsciiString("source");
+ Handle(WOKBuilder_MSEntity) msent;
+ Handle(WOKernel_File) afile;
+
+ Handle(WOKMake_InputFile) buildfile;
+ Handle(WOKMake_OutputFile) outfile;
+
+ for(i=1; i<=tobuild->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ buildfile = tobuild->Value(i);
+
+ msent = Handle(WOKBuilder_MSEntity)::DownCast(buildfile->BuilderEntity());
+
+ if(msent.IsNull())
+ {
+ SetFailed();
+ ErrorMsg << "WOKStep_SourceExtract::Execute"
+ << buildfile->BuilderEntity()->Path()->Name() << " is not a MS Type" << endm;
+ }
+ else
+ {
+ aseq = WOKBuilder_MSTool::GetMSchema()->TypeSourceFiles(msent->Name());
+
+ for(j=1; j<= aseq->Length(); j++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ afile = Locator()->Locate(Unit()->Name(), sourcetype, aseq->Value(j));
+
+ if(afile.IsNull())
+ {
+ WarningMsg << "WOKStep_SourceExtract::Execute"
+ << "Missing CDL deducted source file : " << aseq->Value(j) << endm;
+ afile = new WOKernel_File(aseq->Value(j), Unit(), Unit()->GetFileType("source"));
+ afile->GetPath();
+ }
+
+ outfile = new WOKMake_OutputFile(afile->LocatorName(), afile, Handle(WOKBuilder_Entity)(), afile->Path());
+ outfile->SetLocateFlag(Standard_True);
+ outfile->SetProduction();
+ AddExecDepItem(buildfile, outfile, Standard_True);
+ }
+ }
+ }
+
+ if(Status() == WOKMake_Unprocessed) SetSucceeded();
+ return;
+}
--- /dev/null
+-- File: WOKStep_StaticLibrary.cdl
+-- Created: Fri Oct 25 16:24:17 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+class StaticLibrary from WOKStep inherits WNTLibrary from WOKStep
+
+ uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection,
+ WNTCollector from WOKBuilder
+
+ is
+
+ Create (
+ abp : BuildProcess from WOKMake;
+ aUnit : DevUnit from WOKernel;
+ aCode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ ) returns mutable StaticLibrary from WOKStep;
+ ---Purpose: creates a class instance
+
+ ComputeTool ( me : mutable )
+ returns mutable WNTCollector from WOKBuilder
+ is redefined static protected;
+ ---Purpose: computes build tool
+
+end StaticLibrary;
--- /dev/null
+#include <WOKStep_StaticLibrary.ixx>
+
+#include <WOKBuilder_StaticLibrarian.hxx>
+
+WOKStep_StaticLibrary :: WOKStep_StaticLibrary (
+ const Handle(WOKMake_BuildProcess)& abp,
+ const Handle( WOKernel_DevUnit )& aUnit,
+ const Handle( TCollection_HAsciiString )& aCode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden
+ ) : WOKStep_WNTLibrary ( abp, aUnit, aCode, checked, hidden ) {
+} // end constructor
+
+Handle( WOKBuilder_WNTCollector ) WOKStep_StaticLibrary :: ComputeTool () {
+
+ return new WOKBuilder_StaticLibrarian (
+ new TCollection_HAsciiString ( "LIB" ), Unit () -> Params ()
+ );
+
+} // end WOKStep_StaticLibrary :: ComputeTool
--- /dev/null
+-- File: WOKStep_TKObjList.cdl
+-- Created: Thu Jun 27 17:31:18 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class TKList from WOKStep
+inherits LinkList from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable TKList from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ ---Purpose: 1 - Adds File In list if file is compilable or an admfile
+ -- 2 - Sets Build Flag if file is a compilable
+ returns Boolean from Standard
+ is redefined protected;
+
+ OutOfDateEntities(me:mutable)
+ returns HSequenceOfInputFile from WOKMake
+ is redefined protected;
+
+ GetUnitContributionCodes(me; unit : DevUnit from WOKernel)
+ returns HAsciiString from TCollection is redefined protected;
+
+ AddParcelUnitContribution(me:mutable; theinfile : InputFile from WOKMake; unit : HAsciiString from TCollection)
+ is redefined protected;
+
+ ComputeDependency(me; code : HAsciiString from TCollection; adirectlist : HSequenceOfHAsciiString from TColStd)
+ returns HSequenceOfHAsciiString from TColStd is redefined protected;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+end TKList;
--- /dev/null
+// File: WOKStep_TKList.cxx
+// Created: Wed Jun 26 19:57:33 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_Session.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_Parcel.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+
+
+#include <WOKBuilder_ArchiveLibrary.hxx>
+#include <WOKBuilder_CompressedFile.hxx>
+#include <WOKBuilder_Command.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+#include <WOKMake_HSequenceOfStepOption.hxx>
+
+#include <WOKStep_Compile.hxx>
+
+#include <WOKStep_TKList.ixx>
+
+//=======================================================================
+//function : WOKStep_TKList
+//purpose :
+//=======================================================================
+WOKStep_TKList::WOKStep_TKList(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_LinkList(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TKList::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TKList::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_TKList::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(TCollection_HAsciiString) astr;
+ if(infile->IsLocateAble() && infile->IsPhysic())
+ {
+ if(!infile->File().IsNull())
+ {
+ astr = Unit()->Params().Eval("%FILENAME_PACKAGES");
+
+ if(astr.IsNull())
+ {
+ ErrorMsg << "WOKStep_TKList::HandleInputFile"
+ << "Could not eval parameter %FILENAME_PACKAGES" << endm;
+ SetFailed();
+ return Standard_False;
+ }
+ else if (!strcmp(infile->File()->Name()->ToCString(), astr->ToCString()))
+ {
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ }
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutOfDateEntities
+//purpose :
+//=======================================================================
+Handle(WOKMake_HSequenceOfInputFile) WOKStep_TKList::OutOfDateEntities()
+{
+ return ForceBuild();
+}
+
+
+//=======================================================================
+//function : GetUnitContributionCodes
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TKList::GetUnitContributionCodes(const Handle(WOKernel_DevUnit)& aunit) const
+{
+ Handle(TCollection_HAsciiString) atype = Unit()->Type();
+ Handle(TCollection_HAsciiString) paramname = new TCollection_HAsciiString("%WOKSteps_");
+
+ paramname->AssignCat(Unit()->Type());
+ paramname->AssignCat("_ListWith");
+
+ Handle(TCollection_HAsciiString) codes = aunit->Params().Eval(paramname->ToCString());
+
+ if(codes.IsNull())
+ {
+ WarningMsg << "WOKStep_WNTK::GetUnitContributionCodes"
+ << "Could not eval parameter " << paramname << " in unit " << aunit->UserPathName() << endm;
+ }
+ return codes;
+}
+
+//=======================================================================
+//function : ComputeDependency
+//purpose :
+//=======================================================================
+Handle(TColStd_HSequenceOfHAsciiString) WOKStep_TKList::ComputeDependency(const Handle(TCollection_HAsciiString)& acode,
+ const Handle(TColStd_HSequenceOfHAsciiString)& directlist) const
+{
+ Handle(TColStd_HSequenceOfHAsciiString) SHOULDNOTBECALLED;
+ return SHOULDNOTBECALLED;
+}
+
+
+//=======================================================================
+//function : AddParcelUnitContribution
+//purpose :
+//=======================================================================
+void WOKStep_TKList::AddParcelUnitContribution(const Handle(WOKMake_InputFile)& theinfile,
+ const Handle(TCollection_HAsciiString)& unit)
+{
+#ifndef WNT
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(unit);
+ Handle(TCollection_HAsciiString) libtype = new TCollection_HAsciiString("library");
+
+ Handle(TCollection_HAsciiString) libname = WOKBuilder_ArchiveLibrary::GetLibFileName(Unit()->Params(), aunit->Name());
+ libname->AssignCat(".Z");
+ Handle(WOKernel_File) lib = Locator()->Locate(aunit->Name(), libtype, libname);
+
+ if(!lib.IsNull())
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(lib->LocatorName(), lib,
+ new WOKBuilder_CompressedFile(lib->Path()),
+ lib->Path());
+ outfile->SetReference();
+ outfile->SetExtern();
+ outfile->SetLocateFlag(Standard_True);
+ AddExecDepItem(theinfile, outfile, Standard_True);
+ }
+ return;
+#else
+
+ ErrorMsg << "WOKStep_TKList::AddParcelUnitContribution "
+ << "Cannot add unit " << unit << " from parcel on Windows NT: feature not available" << endm;
+ SetFailed();
+ return;
+
+#endif
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_TKList::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ if(execlist->Length() > 1)
+ {
+ ErrorMsg << "WOKStep_TKList::Execute" << "Too many input files in step" << endm;
+ SetFailed();
+ return;
+ }
+
+ Handle(WOKMake_InputFile) PACKAGES = execlist->Value(1);
+ WOKUtils_AdmFile afile(PACKAGES->File()->Path());
+ Handle(TColStd_HSequenceOfHAsciiString) unitseq = afile.Read();
+ Handle(TCollection_HAsciiString) astr;
+ Standard_Integer i;
+
+ Handle(WOKBuilder_Command) acommand = new WOKBuilder_Command(new TCollection_HAsciiString("COMMAND"),
+ Unit()->Params());
+
+ acommand->SetShell(Shell());
+ if(!Shell()->IsLaunched()) Shell()->Launch();
+
+ for(i=1; i<=unitseq->Length(); i++)
+ {
+ astr = unitseq->Value(i);
+ astr->LeftAdjust();
+ astr->RightAdjust();
+
+ Handle(WOKernel_DevUnit) unit = Locator()->LocateDevUnit(astr);
+
+ if(unit.IsNull())
+ {
+ ErrorMsg << "WOKStep_TKList::Execute"
+ << "Could not locate unit " << astr << " listed in file PACKAGES" << endm;
+ SetFailed();
+ return;
+ }
+
+ AddUnitContribution(PACKAGES, unit->Name());
+
+ }
+ SetSucceeded();
+}
--- /dev/null
+-- File: WOKStep_TKReplace.cdl
+-- Created: Thu Aug 8 14:32:16 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+
+deferred class TKReplace from WOKStep
+inherits LinkList from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ OutputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ IndexedMapOfHAsciiString from WOKTools,
+ MapOfHAsciiString from WOKTools,
+ HSequenceOfHAsciiString from TColStd,
+ HArray2OfBoolean from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Initialize(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable TKReplace from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ HandleInputFile(me:mutable; item : InputFile from WOKMake)
+ ---Purpose: 1 - Adds File In list if file is compilable or an admfile
+ -- 2 - Sets Build Flag if file is a compilable
+ returns Boolean from Standard
+ is redefined protected;
+
+ LoadTKDefs(me:mutable);
+
+ IsAuthorized(me; atk : HAsciiString from TCollection)
+ returns Boolean from Standard;
+
+ GetTKForUnit(me:mutable; aunit : HAsciiString from TCollection)
+ returns HAsciiString from TCollection
+ is protected;
+
+ SubstituteInput(me:mutable; infile : InputFile from WOKMake)
+ returns OutputFile from WOKMake;
+
+ Execute(me:mutable; execlist : HSequenceOfInputFile from WOKMake)
+ is redefined private;
+
+fields
+
+ myuds : IndexedMapOfHAsciiString from WOKTools;
+ mytks : IndexedMapOfHAsciiString from WOKTools;
+
+ myautorized : MapOfHAsciiString from WOKTools;
+ myauthlist : Boolean from Standard;
+
+ mydirecttks : MapOfHAsciiString from WOKTools;
+ myorig : MapOfHAsciiString from WOKTools;
+ mytreated : MapOfHAsciiString from WOKTools;
+ myadded : MapOfHAsciiString from WOKTools;
+ mymatrix : HArray2OfBoolean from TColStd;
+
+end TKReplace;
--- /dev/null
+// File: WOKStep_TKReplace.cxx
+// Created: Thu Aug 8 14:33:43 1996
+// Author: Jean GAUTIER
+// <jga@cobrax.paris1.matra-dtv.fr>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+#include <TColStd_HArray2OfBoolean.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_IndexedMapOfHAsciiString.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+
+#include <WOKernel_Session.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+#include <WOKernel_Parcel.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_UnitGraph.hxx>
+
+#ifndef WNT
+# include <WOKBuilder_ArchiveLibrary.hxx>
+# include <WOKBuilder_SharedLibrary.hxx>
+#else
+# include <WOKNT_WNT_BREAK.hxx>
+# include <WOKBuilder_StaticLibrary.hxx>
+# include <WOKBuilder_ImportLibrary.hxx>
+#endif // WNT
+
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_Command.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+#include <WOKMake_HSequenceOfStepOption.hxx>
+
+
+#include <WOKStep_TKReplace.ixx>
+
+//=======================================================================
+//function : WOKStep_TKReplace
+//purpose :
+//=======================================================================
+WOKStep_TKReplace::WOKStep_TKReplace(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_LinkList(abp,aunit, acode, checked, hidden), myauthlist(Standard_False)
+{
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TKReplace::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TKReplace::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)STTMPDIR);
+ return result;
+}
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_TKReplace::HandleInputFile(const Handle(WOKMake_InputFile)& infile)
+{
+ Handle(WOKBuilder_Entity) result;
+ Handle(WOKUtils_Path) apath;
+
+ if(!infile->File().IsNull())
+ {
+ apath = infile->File()->Path();
+ switch(apath->Extension())
+ {
+#ifndef WNT
+ case WOKUtils_ArchiveFile:
+ result = new WOKBuilder_ArchiveLibrary(apath); break;
+ case WOKUtils_DSOFile:
+ result = new WOKBuilder_SharedLibrary(apath); break;
+#else
+ case WOKUtils_LIBFile:
+ result = new WOKBuilder_StaticLibrary(apath); break;
+ case WOKUtils_IMPFile:
+ result = new WOKBuilder_ImportLibrary(apath); break;
+ case WOKUtils_RESFile:
+#endif // WNT
+ case WOKUtils_ObjectFile:
+ result = new WOKBuilder_ObjectFile(apath); break;
+ default:
+ return Standard_False;
+ }
+
+ infile->SetBuilderEntity(result);
+ infile->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ else
+ {
+ if(!infile->IsPhysic()) return Standard_True;
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : LoadTKDefs
+//purpose :
+//=======================================================================
+void WOKStep_TKReplace::LoadTKDefs()
+{
+ // Liste des Uds connues
+
+ Handle(WOKernel_Workbench) abench = Unit()->Session()->GetWorkbench(Unit()->Nesting());
+ Handle(TColStd_HSequenceOfHAsciiString) aseq = abench->Visibility();
+ Handle(TColStd_HSequenceOfHAsciiString) units;
+ Handle(TCollection_HAsciiString) aunitname;
+ Handle(TCollection_HAsciiString) afullname, abasename;
+ Standard_Integer i,j;
+
+ Handle(WOKernel_File) toolkits = Locator()->Locate(Unit()->Name(),
+ new TCollection_HAsciiString("source"),
+ new TCollection_HAsciiString("TOOLKITS"));
+
+ if(toolkits.IsNull())
+ {
+ for(Standard_Integer i=1; i<=aseq->Length() && toolkits.IsNull(); i++)
+ {
+ Handle(WOKernel_Workbench) abench = Unit()->Session()->GetWorkbench(aseq->Value(i));
+
+ if(!abench.IsNull())
+ {
+ toolkits = new WOKernel_File(new TCollection_HAsciiString("TOOLKITS"),
+ abench,
+ abench->GetFileType("admfile"));
+ toolkits->GetPath();
+ if(!toolkits->Path()->Exists())
+ {
+ toolkits.Nullify();
+ }
+ }
+ }
+ }
+
+ if(!toolkits.IsNull())
+ {
+
+ WOKUtils_AdmFile afile(toolkits->Path());
+ Handle(TColStd_HSequenceOfHAsciiString) aseq = afile.Read();
+
+ if(!aseq.IsNull())
+ {
+ for(i=1; i<=aseq->Length(); i++)
+ {
+ aseq->Value(i)->LeftAdjust();
+ aseq->Value(i)->RightAdjust();
+ myautorized.Add(aseq->Value(i));
+ }
+ myauthlist=Standard_True;
+ }
+ else
+ {
+ WarningMsg << "WOKStep_TKReplace::Execute"
+ << "Unreadable TOOLKITS file not taken into account" << endm;
+ }
+ }
+
+ for(i=1; i<=aseq->Length(); i++)
+ {
+ Handle(WOKernel_UnitNesting) nesting = Unit()->Session()->GetUnitNesting(aseq->Value(i));
+ if(!nesting.IsNull())
+ {
+ nesting->Open();
+
+ units = nesting->Units();
+
+ for(j=1; j<=units->Length(); j++)
+ {
+#ifdef WNT
+ _TEST_BREAK();
+#endif // WNT
+ Handle(WOKernel_DevUnit) aunit;
+
+ aunit = Unit()->Session()->GetDevUnit(units->Value(j));
+
+ if(!aunit.IsNull())
+ {
+ aunitname = aunit->Name();
+
+ if(WOKernel_IsToolkit(aunit))
+ {
+ if(!mytks.Contains(aunitname))
+ {
+ mytks.Add(aunitname);
+ }
+ }
+ else
+ {
+ if(!myuds.Contains(aunitname))
+ {
+ myuds.Add(aunitname);
+ }
+ }
+ }
+ }
+ }
+ }
+
+
+ // Construction de la matrice TK uds.
+
+ if(mytks.Extent() )
+ {
+ Handle(TCollection_HAsciiString) pkgstype = new TCollection_HAsciiString("PACKAGES");
+ Handle(TCollection_HAsciiString) PACKAGESname = Unit()->Params().Eval("%FILENAME_PACKAGES");
+
+ mymatrix = new TColStd_HArray2OfBoolean(1,mytks.Extent(), 1,myuds.Extent(), Standard_False);
+
+ for(i=1; i<=mytks.Extent(); i++)
+ {
+ const Handle(TCollection_HAsciiString)& atk = mytks(i);
+ Handle(WOKernel_File) PACKAGES = Locator()->Locate(atk, pkgstype, PACKAGESname);
+
+ if(PACKAGES.IsNull())
+ {
+ if (IsAuthorized(atk)) {
+ WarningMsg << "WOKStep_TKReplace::Execute"
+ << "Could not find PACKAGES file for toolkit : " << atk << endm;
+ WarningMsg << "WOKStep_TKReplace::Execute"
+ << "Toolkit " << atk << "is ignored" << endm;
+ }
+ }
+ else
+ {
+ WOKUtils_AdmFile afile(PACKAGES->Path());
+ Handle(TColStd_HSequenceOfHAsciiString) udsoftk;
+
+ udsoftk = afile.Read();
+
+ if(udsoftk.IsNull())
+ {
+ ErrorMsg << "WOKStep_TKReplace::Execute"
+ << "Could not read file " << PACKAGES->Path()->Name() << endm;
+ SetFailed();
+ return;
+ }
+
+ for(j=1; j<=udsoftk->Length(); j++)
+ {
+ Standard_Integer udidx = myuds.FindIndex(udsoftk->Value(j));
+
+ if(udidx == 0)
+ {
+ ErrorMsg << "WOKStep_TKReplace::Execute"
+ << "Unknown unit (" << udsoftk->Value(j) << ") listed in packages of : " << atk << endm;
+ SetFailed();
+ return;
+ }
+ else
+ mymatrix->SetValue(i,udidx,Standard_True);
+ }
+ }
+ }
+ }
+
+#ifdef WNT
+
+ // if faut enlever le tk qui contient eventuellement l'ud en cours de construction
+ if(!WOKernel_IsToolkit(Unit()))
+ {
+ Standard_Integer udidx = myuds.FindIndex(Unit()->Name());
+
+ myauthlist=Standard_True;
+
+ for(Standard_Integer tkidx=mymatrix->LowerRow(); tkidx<=mymatrix->UpperRow(); tkidx++)
+ {
+ const Handle(TCollection_HAsciiString)& atk = mytks(tkidx);
+ if(!mymatrix->Value(tkidx, udidx))
+ myautorized.Add(atk);
+ else if(myautorized.Contains(mytks(tkidx)))
+ myautorized.Remove(atk);
+ }
+ }
+ else
+ {
+ // Il faut enlever tous les tks qui contiennent les
+ // Uds de ce TK
+ Standard_Integer curtk = mytks.FindIndex(Unit()->Name());
+ myauthlist=Standard_True;
+
+ // A priori Authoriser tous les toolkits
+ for(Standard_Integer i=1; i<=mytks.Extent(); i++)
+ {
+ if(i!=curtk)
+ {
+ myautorized.Add(mytks(i));
+ }
+ }
+
+ for(Standard_Integer udidx=mymatrix->LowerCol(); udidx<=mymatrix->UpperCol(); udidx++)
+ {
+ if(mymatrix->Value(curtk, udidx))
+ {
+ // Cette ud est dans le TK en cours
+ for(Standard_Integer tkidx=mymatrix->LowerRow(); tkidx<=mymatrix->UpperRow(); tkidx++)
+ {
+ const Handle(TCollection_HAsciiString)& atk = mytks(tkidx);
+ if(mymatrix->Value(tkidx, udidx))
+ myautorized.Remove(atk);
+ }
+ }
+ }
+ }
+#endif
+}
+
+//=======================================================================
+//function : IsAuthorized
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_TKReplace::IsAuthorized(const Handle(TCollection_HAsciiString)& atk) const
+{
+ if(!myauthlist) return Standard_True;
+ else
+ return myautorized.Contains(atk);
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : GetTKForUnit
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TKReplace::GetTKForUnit(const Handle(TCollection_HAsciiString)& aunit)
+{
+ Handle(TCollection_HAsciiString) result;
+
+ if(mytks.Extent())
+ {
+ Standard_Integer i, uidx = myuds.FindIndex(aunit);
+
+ for(i=mymatrix->LowerRow(); i<=mymatrix->UpperRow(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ if(mymatrix->Value(i, uidx))
+ {
+ if(!result.IsNull())
+ {
+ WarningMsg << "WOKStep_TKReplace::GetTKForUnit"
+ << "More than one toolkit contains " << aunit << " using " << result << " ignoring " << mytks(i) << endm;
+ WarningMsg << "WOKStep_TKReplace::GetTKForUnit"
+ << "You can specify the toolkit used using a TOOLKITS file" << endm;
+ }
+ else
+ {
+ const Handle(TCollection_HAsciiString)& astr = mytks(i);
+ if(IsAuthorized(astr))
+ result = astr;
+ }
+ }
+ }
+ }
+ return result;
+}
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : SubstituteInput
+//purpose :
+//=======================================================================
+Handle(WOKMake_OutputFile) WOKStep_TKReplace::SubstituteInput(const Handle(WOKMake_InputFile)& afile)
+{
+#ifndef WNT
+ Standard_Integer k,l;
+ Handle(WOKMake_OutputFile) result,NULLRESULT;
+
+ if(afile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_SharedLibrary)))
+ {
+ Handle(WOKernel_DevUnit) TheUnit = Unit()->Session()->GetDevUnit(afile->File()->Nesting());
+
+ Handle(TCollection_HAsciiString) current = TheUnit->Name();
+
+ Standard_Integer udidx = myuds.FindIndex(current);
+
+ mytreated.Add(current);
+
+ Handle(TCollection_HAsciiString) curtk = GetTKForUnit(current);
+
+ if(!curtk.IsNull())
+ {
+ // gerer l'apparition de ce TK
+ Standard_Integer tkidx = mytks.FindIndex(curtk);
+
+ for(k=mymatrix->LowerCol(); k<=mymatrix->UpperCol(); k++)
+ {
+ if(mymatrix->Value(tkidx, k))
+ {
+ Handle(TCollection_HAsciiString) implied = myuds(k);
+
+ if(!mytreated.Contains(implied) && !myorig.Contains(implied))
+ {
+ Handle(WOKernel_DevUnit) aunit = Locator()->LocateDevUnit(implied);
+
+
+
+ Handle(TColStd_HSequenceOfHAsciiString) directlist = aunit->ImplementationDepList(UnitGraph());
+
+ if (directlist.IsNull()) return NULLRESULT;
+
+ Handle(TColStd_HSequenceOfHAsciiString) suppliers = ComputeDependency(aunit->Name(), directlist);
+
+ if (suppliers.IsNull()) return NULLRESULT;
+
+ for(l=1; l<=suppliers->Length(); l++)
+ {
+ implied = suppliers->Value(l);
+
+ // J'ajoute les EXTERNLIB des packages induits
+ ComputeExternals(implied);
+
+ if(!mytreated.Contains(implied) && !myorig.Contains(implied))
+ {
+ mytreated.Add(implied);
+ Handle(WOKernel_DevUnit) impunit = Locator()->LocateDevUnit(implied);
+ Handle(WOKMake_OutputFile) unitlib = GetUnitLibrary(impunit);
+
+ if (Status()==WOKMake_Failed) return NULLRESULT;
+
+ if (!unitlib.IsNull())
+ {
+ Handle(WOKMake_InputFile) unitinlib = new WOKMake_InputFile(unitlib);
+ unitinlib->SetDirectFlag(Standard_False);
+
+ Handle(WOKMake_OutputFile) outfile = SubstituteInput(unitinlib);
+ if (outfile.IsNull()) return NULLRESULT;
+ outfile->SetExtern();
+
+ Handle(WOKernel_DevUnit) implsubs = Unit()->Session()->GetDevUnit(outfile->File()->Nesting());
+
+ if(!mydirecttks.Contains(implsubs->Name()) && !myorig.Contains(implsubs->Name()))
+ {
+ if(!myadded.Contains(implsubs->Name()))
+ {
+ if(myorig.Contains(current))
+ {
+ WarningMsg << "WOKStep_TKReplace::SubstituteInput"
+ << implied << " (implied by " << curtk << " defining " << current << ")"
+ << " implies addition of " << outfile->ID() << endm;
+ }
+ myadded.Add(implsubs->Name());
+ AddExecDepItem(afile, outfile, Standard_True);
+ }
+ else
+ {
+ AddExecDepItem(afile, outfile, Standard_False);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ Handle(WOKernel_DevUnit) TKUnit = Locator()->LocateDevUnit(curtk);
+
+ // Check de visibilite : unit doit etre "plus loin" que tk
+
+ Handle(TCollection_HAsciiString) tknest = TKUnit->Nesting();
+ Handle(TCollection_HAsciiString) unitnest = TheUnit->Nesting();
+ if (Unit()->Session()->IsWorkbench(unitnest)) {
+ Handle(WOKernel_UnitNesting) thetknest = Unit()->Session()->GetUnitNesting(tknest);
+ Handle(WOKernel_Workbench) theunitwb = Unit()->Session()->GetWorkbench(unitnest);
+
+ if (thetknest != theunitwb) {
+ Handle(TColStd_HSequenceOfHAsciiString) thevisib = theunitwb->Visibility();
+ for (Standard_Integer i=2; i<= thevisib->Length(); i++) {
+ if (!strcmp(thevisib->Value(i)->ToCString(), thetknest->FullName()->ToCString())) {
+ WarningMsg << "WOKStep_TKReplace::SubstituteInput"
+ << "Toolkit " << TKUnit->Name() << " in " << thetknest->Name()
+ << " hides unit " << TheUnit->Name() << " in " << theunitwb->Name() << endm;
+ }
+ }
+ }
+ }
+
+ result = GetUnitLibrary(TKUnit);
+
+ if (Status()==WOKMake_Failed) return NULLRESULT;
+
+ if (!result.IsNull())
+ result->SetExtern();
+ else
+ {
+ result = new WOKMake_OutputFile(afile);
+ result->SetReference();
+ }
+ return result;
+ }
+ else
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(afile);
+ outfile->SetReference();
+ return outfile;
+ }
+ }
+ else
+ {
+ result = new WOKMake_OutputFile(afile);
+ result->SetReference();
+ result->SetMember();
+ }
+ return result;
+#else
+ Handle( WOKMake_OutputFile ) result;
+
+ if ( afile -> BuilderEntity () -> IsKind ( STANDARD_TYPE( WOKBuilder_StaticLibrary ) ) ) {
+
+ Handle( WOKernel_DevUnit ) TheUnit = Unit () -> Session () -> GetDevUnit (
+ afile -> File () -> Nesting ()
+ );
+ Handle( TCollection_HAsciiString ) current = TheUnit -> Name ();
+ Handle( TCollection_HAsciiString ) curtk = GetTKForUnit ( current );
+ Handle( TCollection_HAsciiString ) libname = curtk.IsNull () ? current : curtk;
+
+ if ( !mytreated.Contains ( libname ) ) {
+
+ Handle( WOKernel_DevUnit ) impunit = Locator () -> LocateDevUnit ( libname );
+
+ result = GetUnitLibrary ( impunit );
+
+ if ( !result.IsNull () )
+ {
+ ComputeExternals(impunit->Name());
+ AddExecDepItem ( afile, result, Standard_True );
+ }
+
+ } // end if
+
+ } else {
+
+ result = new WOKMake_OutputFile ( afile );
+ result -> SetReference ();
+
+ } // end else
+
+ return result;
+#endif // WNT
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_TKReplace::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i;
+
+ LoadTKDefs();
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKMake_InputFile) afile = execlist->Value(i);
+
+ if(afile->IsPhysic())
+ {
+#ifndef WNT
+ if(afile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_SharedLibrary)))
+#else
+ if(afile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_StaticLibrary)))
+#endif // WNT
+ {
+ Handle(WOKernel_DevUnit) TheUnit = Unit()->Session()->GetDevUnit(afile->File()->Nesting());
+ Handle(TCollection_HAsciiString) atk = GetTKForUnit(TheUnit->Name());
+
+ if(!atk.IsNull())
+ {
+ mydirecttks.Add(atk);
+ }
+
+ }
+ }
+ }
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKMake_InputFile) afile = execlist->Value(i);
+ if(afile->IsPhysic())
+ {
+#ifndef WNT
+ if(afile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_SharedLibrary)))
+#else
+ if(afile->BuilderEntity()->IsKind(STANDARD_TYPE(WOKBuilder_StaticLibrary)))
+#endif // WNT
+ {
+ Handle(WOKernel_DevUnit) TheUnit = Unit()->Session()->GetDevUnit(afile->File()->Nesting());
+ if(!myorig.Contains(TheUnit->Name()))
+ {
+ myorig.Add(TheUnit->Name());
+ }
+ }
+ }
+ }
+
+ if(!CheckStatus("LoadTkDefs"))
+ {
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+#ifdef WNT
+_TEST_BREAK();
+#endif // WNT
+ Handle(WOKMake_InputFile) afile = execlist->Value(i);
+
+ if(afile->IsPhysic())
+ {
+ Handle(WOKMake_OutputFile) outfile = SubstituteInput(execlist->Value(i));
+
+ if(!outfile.IsNull())
+ {
+ AddExecDepItem(afile, outfile, Standard_True);
+ }
+ else
+ {
+ SetFailed();
+ return;
+ }
+ }
+ else
+ {
+ Handle(WOKMake_OutputFile) outfile = new WOKMake_OutputFile(afile);
+
+ outfile->SetReference();
+ AddExecDepItem(afile, outfile, Standard_True);
+ }
+ }
+ }
+
+ if(!CheckStatus("LoadTkDefs"))
+ {
+ SetSucceeded();
+ }
+
+ myuds.Clear();
+ mytks.Clear();
+
+ myautorized.Clear();
+ mydirecttks.Clear();
+ mytreated.Clear();
+ myorig.Clear();
+ myadded.Clear();
+ mymatrix.Nullify();
+ return;
+}
+
+
--- /dev/null
+
+
+
+proc WOKStep_TclLibIdep::AdmFileType {} {
+ return "stadmfile";
+}
+
+proc WOKStep_TclLibIdep::OutputDirTypeName {} {
+ return "sttmpfile";
+}
+
+
+proc WOKStep_TclLibIdep::HandleInputFile { ID } {
+
+ scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name
+ if {$name == "PACKAGES"} {
+ return 1
+ }
+
+ return 0
+}
+
+proc WOKStep_TclLibIdep::Execute { unit args } {
+
+ msgprint -i -c "WOKStep_TclLibIdep::Execute" "Build ImplDep"
+
+ set unitname [wokinfo -n $unit]
+
+ set file [lindex $args 0]
+ scan $file "%\[^:\]:%\[^:\]:%\[^:\]" Unit type name
+ set packfile [woklocate -p $file $unit]
+
+ if {[clength $packfile] == 0} {
+ msgprint -e -c "WOKStep_TclLibIdep::Execute" "Could not locate PACKAGES for unit $unit"
+ return 1;
+ } else {
+ for_file anud $packfile {
+ set curud [string trim $anud]
+ if {$curud != ""} {
+ set alluds($curud) 1
+ set impin [woklocate -p ${curud}:stadmfile:${curud}.ImplDep]
+ if {[clength $impin] == 0} {
+ msgprint -i "No ImplDep file for unit $curud"
+ } else {
+ for_file adep $impin {
+ set curud [string trim $adep]
+ set alluds($curud) 1
+ }
+ }
+ }
+ }
+# remove PACKAGES content from ImplDep
+ for_file anud $packfile {
+ set curud [string trim $anud]
+ if {$curud != ""} {
+ unset alluds($curud)
+ }
+ }
+ set impfile [wokinfo -p stadmfile:${unitname}.ImplDep $unit]
+ set impid [open $impfile "w"]
+ for_array_keys anud alluds {
+ puts $impid $anud
+ }
+ close $impid
+ stepoutputadd ${unitname}:stadmfile:${unitname}.ImplDep
+ stepaddexecdepitem -d $file ${unitname}:stadmfile:${unitname}.ImplDep
+ }
+ return 0;
+}
--- /dev/null
+-- File: WOKStep_TemplateExtract.cdl
+-- Created: Thu Jun 27 17:23:27 1996
+-- Author: Jean GAUTIER
+-- <jga@cobrax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1996
+
+class TemplateExtract from WOKStep
+inherits Extract from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable TemplateExtract from WOKStep;
+
+ AdmFileType(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+ OutputDirTypeName(me)
+ returns HAsciiString from TCollection
+ is redefined protected;
+
+end TemplateExtract;
--- /dev/null
+// File: WOKStep_TemplateExtract.cxx
+// Created: Mon Nov 13 22:08:50 1995
+// Author: Jean GAUTIER
+// <jga@cobrax>
+
+#include <WOKBuilder_MSTemplateExtractor.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+
+#include <WOKStep_TemplateExtract.ixx>
+
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : WOKStep_TemplateExtract
+//purpose :
+//=======================================================================
+WOKStep_TemplateExtract::WOKStep_TemplateExtract(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Extract(abp,aunit, acode, checked, hidden)
+{
+ SetExtractor(new WOKBuilder_MSTemplateExtractor(Unit()->Params()));
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TemplateExtract::AdmFileType() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)ADMFILE);
+ return result;
+}
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_TemplateExtract::OutputDirTypeName() const
+{
+ static Handle(TCollection_HAsciiString) result = new TCollection_HAsciiString((char*)TMPDIR);
+ return result;
+}
--- /dev/null
+-- File: WOKStep_ToolkitSource.cdl
+-- Created: Thu May 29 11:07:13 1997
+-- Author: Jean GAUTIER
+-- <jga@hourax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+class ToolkitSource from WOKStep
+inherits Source from WOKStep
+
+ ---Purpose: Computes Toolkit Source File
+ -- List.
+
+uses
+ BuildProcess from WOKMake,
+ InputFile from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ DevUnit from WOKernel,
+ File from WOKernel,
+ HSequenceOfFile from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HAsciiString from TCollection
+
+is
+
+ Create(abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable ToolkitSource from WOKStep;
+
+ GetPACKAGES(me)
+ returns File from WOKernel
+ is protected;
+
+ AddPACKAGES(me:mutable; unitcdl : InputFile from WOKMake) is protected;
+
+ Execute(me: mutable; execlist : HSequenceOfInputFile from WOKMake)
+ ---Purpose: Executes step
+ -- Computes output files
+ is redefined private;
+
+end ToolkitSource;
+
+
--- /dev/null
+// File: WOKStep_ToolkitSource.cxx
+// Created: Thu May 29 11:33:37 1997
+// Author: Jean GAUTIER
+// <jga@hourax.paris1.matra-dtv.fr>
+
+
+
+#include <WOKStep_ToolkitSource.ixx>
+
+#include <WOKernel_FileType.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Param.hxx>
+#include <WOKTools_Messages.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <TCollection_HAsciiString.hxx>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+//=======================================================================
+//Author : Jean Gautier (jga)
+//function : WOKStep_ToolkitSource
+//purpose :
+//=======================================================================
+WOKStep_ToolkitSource::WOKStep_ToolkitSource(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_Source(abp, aunit, acode, checked, hidden)
+{
+}
+
+//=======================================================================
+//function : GetFILES
+//purpose :
+//=======================================================================
+Handle(WOKernel_File) WOKStep_ToolkitSource::GetPACKAGES() const
+{
+ Handle(TCollection_HAsciiString) astr = Unit()->Params().Eval("%FILENAME_PACKAGES");
+ Handle(TCollection_HAsciiString) asourcetype = new TCollection_HAsciiString("source");
+ Handle(WOKernel_File) afile = Locator()->Locate(Unit()->Name(), asourcetype, astr);
+ return afile;
+}
+
+
+//=======================================================================
+//function : AddPACKAGES
+//purpose :
+//=======================================================================
+void WOKStep_ToolkitSource::AddPACKAGES(const Handle(WOKMake_InputFile)& PACKAGES)
+{
+ Handle(WOKernel_File) afile;
+ Handle(TCollection_HAsciiString) sourcetype = new TCollection_HAsciiString("source");
+ Standard_Integer i;
+
+ // le fichier PACKAGES
+ WOKUtils_Param params = Unit()->Params();
+
+ if(PACKAGES.IsNull() == Standard_False)
+ {
+ // le fichier PACKAGES produit PACKAGES
+ Handle(WOKMake_OutputFile) OUTFILES = new WOKMake_OutputFile(PACKAGES->File()->LocatorName(), PACKAGES->File(),
+ Handle(WOKBuilder_Entity)(), PACKAGES->File()->Path());
+
+ OUTFILES->SetProduction();
+ OUTFILES->SetLocateFlag(Standard_True);
+ AddExecDepItem(PACKAGES, OUTFILES, Standard_True);
+ }
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_ToolkitSource::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Handle(WOKernel_File) PACKAGES = GetPACKAGES();
+
+ if(!PACKAGES.IsNull())
+ {
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(PACKAGES->LocatorName(), PACKAGES,
+ Handle(WOKBuilder_Entity)(), PACKAGES->Path());
+ infile->SetLocateFlag(Standard_True);
+ infile->SetDirectFlag(Standard_True);
+ execlist->Append(infile);
+ AddPACKAGES(infile);
+ }
+
+ Handle(WOKernel_File) FILES = GetFILES();
+
+ if(!FILES.IsNull())
+ {
+ Handle(WOKMake_InputFile) infile = new WOKMake_InputFile(FILES->LocatorName(), FILES,
+ Handle(WOKBuilder_Entity)(), FILES->Path());
+ infile->SetLocateFlag(Standard_True);
+ infile->SetDirectFlag(Standard_True);
+ execlist->Append(infile);
+ ReadFILES(infile);
+ }
+
+ if (Status() != WOKMake_Failed)
+ SetSucceeded();
+
+ return;
+}
--- /dev/null
+-- File: WOKStep_TransitiveLinkList.cdl
+-- Created: Tue Dec 2 18:16:48 1997
+-- Author: Jean GAUTIER
+-- <jga@hourax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+
+class TransitiveLinkList from WOKStep
+inherits ComputeLinkList from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Create( abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable TransitiveLinkList from WOKStep;
+
+
+ ComputeDependency(me; code : HAsciiString from TCollection; adirectlist : HSequenceOfHAsciiString from TColStd)
+ returns HSequenceOfHAsciiString from TColStd is redefined protected;
+
+end TransitiveLinkList;
--- /dev/null
+// File: WOKStep_TransitiveLinkList.cxx
+// Created: Tue Dec 2 18:19:36 1997
+// Author: Jean GAUTIER
+// <jga@hourax.paris1.matra-dtv.fr>
+
+
+#include <WOKStep_TransitiveLinkList.ixx>
+
+
+//=======================================================================
+//function : WOKStep_TransitiveLinkList
+//purpose :
+//=======================================================================
+ WOKStep_TransitiveLinkList::WOKStep_TransitiveLinkList(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_ComputeLinkList(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//function : ComputeDependency
+//purpose :
+//=======================================================================
+Handle(TColStd_HSequenceOfHAsciiString) WOKStep_TransitiveLinkList::ComputeDependency(const Handle(TCollection_HAsciiString)& acode,
+ const Handle(TColStd_HSequenceOfHAsciiString)& directlist) const
+{
+ return WOKernel_DevUnit::ImplementationDep(UnitGraph(), acode, directlist);
+}
--- /dev/null
+-- File: WOKStep_TransitiveTKReplace.cdl
+-- Created: Tue Dec 2 18:51:19 1997
+-- Author: Jean GAUTIER
+-- <jga@hourax.paris1.matra-dtv.fr>
+---Copyright: Matra Datavision 1997
+
+class TransitiveTKReplace from WOKStep
+inherits TKReplace from WOKStep
+
+ ---Purpose:
+
+uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+is
+
+ Create( abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked, hidden : Boolean from Standard)
+ returns mutable TransitiveTKReplace from WOKStep;
+
+
+ ComputeDependency(me; code : HAsciiString from TCollection; adirectlist : HSequenceOfHAsciiString from TColStd)
+ returns HSequenceOfHAsciiString from TColStd is redefined protected;
+
+end TransitiveTKReplace;
--- /dev/null
+// File: WOKStep_TransitiveTKReplace.cxx
+// Created: Tue Dec 2 18:19:36 1997
+// Author: Jean GAUTIER
+// <jga@hourax.paris1.matra-dtv.fr>
+
+
+#include <WOKStep_TransitiveTKReplace.ixx>
+
+
+//=======================================================================
+//function : WOKStep_TransitiveTKReplace
+//purpose :
+//=======================================================================
+ WOKStep_TransitiveTKReplace::WOKStep_TransitiveTKReplace(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_TKReplace(abp,aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//function : ComputeDependency
+//purpose :
+//=======================================================================
+Handle(TColStd_HSequenceOfHAsciiString) WOKStep_TransitiveTKReplace::ComputeDependency(const Handle(TCollection_HAsciiString)& acode,
+ const Handle(TColStd_HSequenceOfHAsciiString)& directlist) const
+{
+ return WOKernel_DevUnit::ImplementationDep(UnitGraph(), acode, directlist);
+}
+
--- /dev/null
+-- File: WOKStep_WNTCollect.cdl
+-- Created: Tue Oct 22 09:54:53 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+deferred class WNTCollect from WOKStep inherits Step from WOKMake
+
+ uses
+
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection,
+ HSequenceOfObjectFile from WOKBuilder,
+ HSequenceOfInputFile from WOKMake,
+ WNTCollector from WOKBuilder,
+ OutputFile from WOKMake,
+ MapOfHAsciiString from WOKTools,
+ IndexedMapOfHAsciiString from WOKTools,
+ HArray2OfBoolean from TColStd
+
+ is
+
+ Initialize (
+ abp : BuildProcess from WOKMake;
+ aUnit : DevUnit from WOKernel;
+ aCode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ );
+ ---Purpose: provides initialization
+
+ AdmFileType ( me )
+ returns HAsciiString from TCollection
+ is redefined static protected;
+ ---Purpose: returns type of ADM file
+
+ ComputeTool ( me : mutable )
+ returns mutable WNTCollector from WOKBuilder
+ is deferred protected;
+ ---Purpose: computes build tool
+
+ ComputeObjectList (
+ me : mutable;
+ anInput : HSequenceOfInputFile from WOKMake
+ )
+ returns mutable HSequenceOfObjectFile from WOKBuilder
+ is virtual protected;
+ ---Purpose: computes object list to build
+
+ OutputDirTypeName ( me )
+ returns HAsciiString from TCollection
+ is redefined static protected;
+ ---Purpose: returns output directoty type name
+
+ CompleteExecList (
+ me : mutable;
+ anExecList : HSequenceOfInputFile from WOKMake
+ ) is redefined static protected;
+
+ HandleOutputFile (
+ me : mutable;
+ aFile : OutputFile from WOKMake
+ ) returns Boolean from Standard
+ is redefined static protected;
+
+ fields
+
+ myInitFlag : Boolean from Standard;
+
+ myuds : IndexedMapOfHAsciiString from WOKTools;
+ mytks : IndexedMapOfHAsciiString from WOKTools;
+
+ myautorized : MapOfHAsciiString from WOKTools;
+ myauthlist : Boolean from Standard;
+
+ mytreated : MapOfHAsciiString from WOKTools;
+ mymatrix : HArray2OfBoolean from TColStd;
+
+end WNTCollect;
--- /dev/null
+#include <WOKStep_WNTCollect.ixx>
+
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_UnitNesting.hxx>
+#include <WOKernel_Workbench.hxx>
+
+#include <WOKMake_InputFile.hxx>
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKTools_Messages.hxx>
+#include <WOKTools_MapOfHAsciiString.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Path.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+//=======================================================================
+//function : WOKStep_WNTCollect
+//purpose :
+//=======================================================================
+WOKStep_WNTCollect::WOKStep_WNTCollect(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aUnit,
+ const Handle(TCollection_HAsciiString)& aCode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKMake_Step(abp, aUnit, aCode, checked, hidden)
+{
+ myInitFlag = Standard_True;
+}
+
+//=======================================================================
+//function : AdmFileType
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_WNTCollect::AdmFileType()const
+{
+ static Handle(TCollection_HAsciiString)retVal = new TCollection_HAsciiString((Standard_CString)STADMFILE);
+ return retVal;
+}
+
+//=======================================================================
+//function : OutputDirTypeName
+//purpose :
+//=======================================================================
+Handle(TCollection_HAsciiString) WOKStep_WNTCollect::OutputDirTypeName()const
+{
+ static Handle(TCollection_HAsciiString)retVal = new TCollection_HAsciiString((Standard_CString)STTMPDIR);
+ return retVal;
+}
+
+//=======================================================================
+//function : ComputeObjectList
+//purpose :
+//=======================================================================
+Handle(WOKBuilder_HSequenceOfObjectFile) WOKStep_WNTCollect::ComputeObjectList(const Handle(WOKMake_HSequenceOfInputFile)& anInput)
+{
+ Handle(WOKBuilder_ObjectFile)obj;
+ Handle(WOKBuilder_HSequenceOfObjectFile)retVal = new WOKBuilder_HSequenceOfObjectFile;
+
+ for(int i = 1; i <= anInput->Length(); ++i)
+ {
+ obj = Handle(WOKBuilder_ObjectFile)::DownCast(anInput->Value(i)->BuilderEntity());
+ if( !obj.IsNull())retVal->Append(obj);
+ }
+
+ return retVal;
+}
+
+//=======================================================================
+//function : CompleteExecList
+//purpose :
+//=======================================================================
+void WOKStep_WNTCollect::CompleteExecList(const Handle(WOKMake_HSequenceOfInputFile)& anExecList)
+{
+
+ if(anExecList->Length() &&
+ myinflow.Extent()> anExecList->Length()&&
+ !mydepmatrix.IsNull())
+ {
+ Standard_Integer i;
+ Standard_Boolean found = Standard_False;
+ WOKTools_MapOfHAsciiString map;
+
+ for(i = 1; i <= anExecList->Length(); ++i)
+ map.Add(anExecList->Value(i)->ID());
+
+ for(i = 1; i <= myinflow.Extent()&& !found; ++i)
+ if(!map.Contains( myinflow(i)->ID()))
+ {
+ anExecList->Append( myinflow(i));
+ found = Standard_True;
+ }
+ }
+
+ WOKMake_Step::CompleteExecList(anExecList);
+}
+
+//=======================================================================
+//function : HandleOutputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_WNTCollect::HandleOutputFile(const Handle(WOKMake_OutputFile)& aFile)
+{
+ return Standard_False;
+}
--- /dev/null
+-- File: WOKStep_WNTK.cdl
+-- Created: Mon Oct 28 12:09:06 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+class WNTK from WOKStep inherits TKList from WOKStep
+
+ uses
+
+ BuildProcess from WOKMake,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake,
+ DevUnit from WOKernel,
+ HSequenceOfFile from WOKernel,
+ File from WOKernel,
+ HSequenceOfEntity from WOKBuilder,
+ HSequenceOfPath from WOKUtils,
+ HSequenceOfHAsciiString from TColStd,
+ HAsciiString from TCollection
+
+ is
+
+ Create (
+ abp : BuildProcess from WOKMake;
+ aunit : DevUnit from WOKernel;
+ acode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ ) returns mutable WNTK from WOKStep;
+
+ HandleInputFile (
+ me : mutable;
+ anItem : InputFile from WOKMake
+ ) returns Boolean from Standard
+ is redefined static;
+
+
+ Execute (
+ me : mutable;
+ anExecList : HSequenceOfInputFile from WOKMake
+ ) is redefined static;
+
+end WNTK;
--- /dev/null
+
+#include <WOKStep_WNTK.ixx>
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_Locator.hxx>
+#include <WOKernel_DevUnit.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_UnitNesting.hxx>
+
+#include <WOKMake_AdmFileTypes.hxx>
+#include <WOKMake_HSequenceOfOutputFile.hxx>
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKUtils_AdmFile.hxx>
+#include <WOKUtils_Path.hxx>
+#include <WOKUtils_Shell.hxx>
+#include <WOKUtils_ShellManager.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <stdlib.h>
+#include <fstream.h>
+
+#ifdef WNT
+# include <WOKNT_WNT_BREAK.hxx>
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_WNTK
+//purpose :
+//=======================================================================
+WOKStep_WNTK::WOKStep_WNTK(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aunit,
+ const Handle(TCollection_HAsciiString)& acode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_TKList(abp, aunit, acode, checked, hidden)
+{
+}
+
+
+//=======================================================================
+//function : HandleInputFile
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_WNTK::HandleInputFile(const Handle(WOKMake_InputFile)& anItem)
+{
+ Handle(TCollection_HAsciiString) filePACKAGES;
+
+ if( anItem->IsLocateAble () &&
+ anItem->IsPhysic () &&
+ !anItem->File().IsNull())
+ {
+
+ filePACKAGES = Unit()->Params().Eval("%FILENAME_PACKAGES");
+
+ if(filePACKAGES.IsNull())
+ {
+ ErrorMsg << "WOKStep_WNTK::HandleInputFile"
+ << "Could not eval parameter '%FILENAME_PACKAGES'" << endm;
+ SetFailed();
+ return Standard_False;
+ }
+
+ if( anItem->File()->Name()->IsSameString(filePACKAGES) )
+ {
+ anItem->SetDirectFlag(Standard_True);
+ return Standard_True;
+ }
+ }
+ return Standard_False;
+}
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_WNTK::Execute(const Handle(WOKMake_HSequenceOfInputFile)& anExecList)
+{
+ if( anExecList->Length() > 1 )
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Too many input files in step" << endm;
+ SetFailed();
+ return;
+ }
+
+ Handle(TCollection_HAsciiString) aStr;
+ Handle(WOKernel_DevUnit) unit;
+ Handle(WOKernel_UnitNesting) nest;
+ Handle(WOKUtils_Path) path;
+
+ Handle(WOKMake_InputFile) PACKAGES = anExecList->Value(1);
+
+ WOKUtils_AdmFile aFile( PACKAGES->File()->Path() );
+
+ Handle(TColStd_HSequenceOfHAsciiString) unitSeq = aFile.Read();
+
+ Unit()->Params().Set("%DebugMode",Unit()->Session()->DebugMode() ? "True" : "False");
+
+ Handle(WOKernel_File) stubFile = new WOKernel_File(new TCollection_HAsciiString("__stub.c"), Unit(),
+ Unit()->GetFileType("object"));
+
+ stubFile->GetPath();
+ Unit()->Params().Set( "%StubDir", stubFile->Path()->DirName()->ToCString() );
+
+ Handle(TCollection_HAsciiString) stubIn = Unit()->Params().Eval("STUBS_FileNameSrc");
+
+ if(stubIn.IsNull())
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Could not eval parameter " << stubIn << endm;
+ SetFailed();
+ return;
+ }
+
+ Handle(TCollection_HAsciiString) stubOut = Unit()->Params().Eval("STUBS_FileNameDst");
+
+ if(stubOut.IsNull())
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Could not eval parameter " << stubOut << endm;
+ SetFailed();
+ return;
+ }
+
+ Unit()->Params().Set( "%StubInput", stubIn ->ToCString() );
+ Unit()->Params().Set( "%StubOutput", stubOut->ToCString() );
+
+ ofstream os( stubIn->ToCString(), ios::trunc );
+
+ if(!os)
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Could not create stub file" << endm;
+ SetFailed();
+ return;
+ }
+
+ os << "char* __COMPONENTS__[] = {\n";
+
+ for(int i = 1; i <= unitSeq->Length(); ++i)
+ {
+#ifdef WNT
+ _TEST_BREAK();
+#endif // WNT
+ aStr = unitSeq->Value(i);
+
+ aStr->LeftAdjust();
+ aStr->RightAdjust();
+
+ unit = Locator()->LocateDevUnit(aStr);
+
+ if( unit.IsNull() )
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Could not locate unit " << aStr << " listed in PACKAGES file" << endm;
+ SetFailed();
+ return;
+ }
+
+ if( !(WOKernel_IsPackage(unit) || WOKernel_IsNocdlpack(unit) || WOKernel_IsDelivery(unit)))
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Unit " << aStr << " of type " << unit->Type()
+ << " can not be listed in PACKAGES file" << endm;
+ SetFailed();
+ return;
+ }
+
+ AddUnitContribution(PACKAGES, unit->Name());
+
+ // Il faut linker avec les externals des uds de PACKAGES
+ ComputeExternals(unit->Name());
+
+ os << " \"" << aStr->ToCString() << "\"" ;
+ os <<( ( i == unitSeq->Length() ) ? ",\n(char*)0\n};" : ",\n" );
+ }
+
+ if( !os.good() )
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Could not create stub file" << endm;
+ SetFailed();
+ return;
+ }
+
+ os.close();
+
+ Handle(WOKUtils_Shell) sh = WOKUtils_ShellManager::GetShell();
+ Handle(TCollection_HAsciiString) cmd = Unit()->Params().Eval("STUBS_COMPILE");
+
+ if( cmd.IsNull() )
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Could not eval template STUBS_COMPILE" << endm;
+ SetFailed();
+ return;
+ }
+
+ sh->Execute(cmd);
+ sh->ClearOutput();
+
+ if(sh->Status())
+ {
+ ErrorMsg << "WOKStep_WNTK::Execute"
+ << "Could not compile stub file" << endm;
+ SetFailed();
+ return;
+ }
+ SetSucceeded();
+}
+
--- /dev/null
+-- File: WOKStep_WNTLibrary.cdl
+-- Created: Fri Oct 25 16:14:54 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+deferred class WNTLibrary from WOKStep inherits WNTCollect from WOKStep
+
+ uses
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection,
+ HSequenceOfInputFile from WOKMake,
+ InputFile from WOKMake
+
+ is
+
+ Initialize (
+ abp : BuildProcess from WOKMake;
+ aUnit : DevUnit from WOKernel;
+ aCode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ );
+ ---Purpose: provides initialization
+
+ Execute (
+ me : mutable;
+ anExecList : HSequenceOfInputFile from WOKMake
+ ) is redefined static;
+ ---Purpose: executes a tool
+
+ HandleInputFile (
+ me : mutable;
+ anItem : InputFile from WOKMake
+ ) returns Boolean from Standard is redefined static;
+ ---Purpose: adds a file in list if the file is input for step
+
+end WNTLibrary;
--- /dev/null
+#include <WOKStep_WNTLibrary.ixx>
+
+#include <WOKernel_File.hxx>
+
+#include <WOKUtils_Path.hxx>
+
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_DEFile.hxx>
+#include <WOKBuilder_WNTLibrarian.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+WOKStep_WNTLibrary::WOKStep_WNTLibrary(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aUnit,
+ const Handle(TCollection_HAsciiString)& aCode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+: WOKStep_WNTCollect(abp, aUnit, aCode, checked, hidden)
+{
+} // end constructor
+
+Standard_Boolean WOKStep_WNTLibrary::HandleInputFile (const Handle(WOKMake_InputFile)& anItem)
+{
+ Handle(WOKBuilder_Entity) res;
+ Handle(WOKUtils_Path) path;
+
+ if(!anItem->File().IsNull())
+ {
+ path = anItem->File()->Path();
+
+ switch (path->Extension())
+ {
+ case WOKUtils_ObjectFile:
+ res = new WOKBuilder_ObjectFile(path);
+ break;
+ case WOKUtils_DEFile:
+ if(path->BaseName()->IsSameString(Unit()->Name()))
+ res = new WOKBuilder_DEFile(path);
+ else
+ return Standard_False;
+ break;
+ default:
+ return Standard_False;
+ }
+
+ anItem->SetBuilderEntity(res);
+ anItem->SetDirectFlag(Standard_True);
+
+ return Standard_True;
+ }
+ return Standard_False;
+}
+
+void WOKStep_WNTLibrary::Execute (const Handle(WOKMake_HSequenceOfInputFile)& anExecList)
+{
+ Standard_Boolean fDefFile = Standard_False;
+ Handle(WOKBuilder_DEFile) defFile;
+
+ Handle(WOKernel_FileType) libType = Unit()->GetFileType("library");
+
+ Handle(TCollection_HAsciiString) target = OutputDir()->Name();
+
+ target->AssignCat(Unit()->Name());
+
+ Handle(WOKBuilder_WNTLibrarian) tool = Handle(WOKBuilder_WNTLibrarian)::DownCast(ComputeTool());
+
+ tool->SetTargetName(target);
+
+ if(!tool->OpenCommandFile())
+ {
+ SetFailed ();
+ return;
+ }
+
+ tool->ProduceObjectList(ComputeObjectList(anExecList));
+
+ for(Standard_Integer i=1; i<=anExecList->Length(); ++i )
+ {
+ defFile = Handle(WOKBuilder_DEFile)::DownCast(anExecList->Value(i)->BuilderEntity());
+
+ if(!defFile.IsNull())
+ {
+ Unit()->Params().Set("%LibraryDEFile", defFile->Path()->Name()->ToCString());
+ fDefFile = Standard_True;
+ break;
+ }
+
+ }
+
+ if(!fDefFile)
+ Unit()->Params().Set( "%LibraryDEFile", "" );
+
+ if(!tool->CloseCommandFile())
+ {
+ SetFailed ();
+ return;
+ }
+
+ tool->SetShell(Shell());
+
+ switch(tool->Execute())
+ {
+ case WOKBuilder_Success:
+ {
+ Standard_Integer numRes = 0;
+ Standard_Integer numProd = tool->Produces()->Length();
+
+ Handle(WOKernel_File) libPath;
+ Handle(WOKBuilder_Entity) outEnt;
+ Handle(WOKMake_OutputFile) outFile;
+
+ for (Standard_Integer i=1; i<=numProd; ++i)
+ {
+ outEnt = tool->Produces()->Value (i);
+
+ libPath = new WOKernel_File (outEnt->Path()->FileName(), Unit(), libType);
+ libPath->GetPath();
+
+ if(outEnt->Path()->Exists())
+ {
+ ++numRes;
+ outEnt->Path()->MoveTo(libPath->Path());
+
+ outFile = new WOKMake_OutputFile(libPath->LocatorName(), libPath, outEnt, libPath->Path());
+
+ outFile->SetLocateFlag(Standard_True);
+ outFile->SetProduction();
+
+ for (Standard_Integer j=1; j<=anExecList->Length(); ++j)
+ AddExecDepItem(anExecList->Value(j), outFile, Standard_True);
+
+ }
+ }
+
+ if(numRes != numProd)
+
+ WarningMsg << "WOKStep_WNTLibrary :: Execute"
+ << tool -> Produces () -> Value ( 1 ) -> Path () -> FileName ()
+ << " does not contain exported symbols" << endm;
+
+ SetSucceeded ();
+ }
+ break;
+ case WOKBuilder_Failed:
+ SetFailed();
+ break;
+ }
+}
+
--- /dev/null
+-- File: WOKStep_WNTLink.cdl
+-- Created: Tue Oct 22 09:45:42 1996
+-- Author: PLOTNIKOV Eugeny
+-- <eugeny@maniax>
+---Copyright: Matra Datavision 1996
+
+deferred class WNTLink from WOKStep inherits WNTCollect from WOKStep
+
+ uses
+
+ BuildProcess from WOKMake,
+ DevUnit from WOKernel,
+ HAsciiString from TCollection,
+ InputFile from WOKMake,
+ HSequenceOfLibrary from WOKBuilder,
+ HSequenceOfHAsciiString from TColStd,
+ HSequenceOfInputFile from WOKMake
+
+ is
+
+ Initialize (
+ abp : BuildProcess from WOKMake;
+ aUnit : DevUnit from WOKernel;
+ aCode : HAsciiString from TCollection;
+ checked : Boolean from Standard;
+ hidden : Boolean from Standard
+ );
+ ---Purpose: provides initialization
+
+ ComputeLibraryList (
+ me : mutable;
+ anInput : HSequenceOfInputFile from WOKMake
+ )
+ returns mutable HSequenceOfLibrary from WOKBuilder
+ is deferred protected;
+ ---Purpose: computes library list to build a target
+
+ ComputeExternals ( me : mutable; anInput : HSequenceOfInputFile from WOKMake)
+ returns mutable HSequenceOfHAsciiString from TColStd
+ is virtual protected;
+ ---Purpose: computes list of external files
+
+ Execute (
+ me : mutable;
+ anExecList : HSequenceOfInputFile from WOKMake
+ ) is redefined static;
+ ---Purpose: executes a tool
+
+ HandleInputFile (
+ me : mutable;
+ anItem : InputFile from WOKMake
+ ) returns Boolean from Standard is redefined static;
+ ---Purpose: adds a file in list if the file is input for step
+
+ fields
+
+ myTarget : HAsciiString from TCollection is protected;
+
+end WNTLink;
--- /dev/null
+
+#define STRICT
+
+#include <MMgt_StorageManager.hxx>
+
+#include <TColStd_HSequenceOfHAsciiString.hxx>
+
+#include <WOKUtils_Path.hxx>
+
+#include <WOKernel_File.hxx>
+#include <WOKernel_Session.hxx>
+#include <WOKernel_BasicUnitTypes.hxx>
+
+#include <WOKBuilder_ObjectFile.hxx>
+#include <WOKBuilder_StaticLibrary.hxx>
+#include <WOKBuilder_ImportLibrary.hxx>
+#include <WOKBuilder_ExportLibrary.hxx>
+#include <WOKBuilder_DEFile.hxx>
+#include <WOKBuilder_WNTLinker.hxx>
+#include <WOKBuilder_HSequenceOfEntity.hxx>
+#include <WOKBuilder_MSTool.hxx>
+#include <WOKBuilder_MSchema.hxx>
+
+#include <WOKMake_OutputFile.hxx>
+
+#include <WOKTools_Messages.hxx>
+
+#include <WOKStep_DLLink.hxx>
+#include <WOKStep_EXELink.hxx>
+
+#include <WOKStep_WNTLink.ixx>
+
+// ###### REFERENCER LE STORAGE MANAGER DES COLLECTIONS ######
+extern Standard_IMPORT MMgt_StorageManager aStorageManager;
+
+#ifdef WNT
+#include <windows.h>
+#endif // WNT
+
+//=======================================================================
+//function : WOKStep_WNTLink
+//purpose :
+//=======================================================================
+WOKStep_WNTLink::WOKStep_WNTLink(const Handle(WOKMake_BuildProcess)& abp,
+ const Handle(WOKernel_DevUnit)& aUnit,
+ const Handle(TCollection_HAsciiString)& aCode,
+ const Standard_Boolean checked,
+ const Standard_Boolean hidden)
+ : WOKStep_WNTCollect(abp, aUnit, aCode, checked, hidden)
+{
+} // end constructor
+
+//=======================================================================
+//function :
+//purpose :
+//=======================================================================
+Standard_Boolean WOKStep_WNTLink::HandleInputFile(const Handle(WOKMake_InputFile)& anItem)
+{
+
+ Handle(WOKBuilder_Entity) res;
+ Handle(WOKUtils_Path) path;
+
+ if(!anItem->File().IsNull())
+ {
+ path = anItem->File()->Path();
+
+ switch(path->Extension())
+ {
+ case WOKUtils_RESFile:
+ case WOKUtils_ObjectFile:
+ res = new WOKBuilder_ObjectFile(path);
+ break;
+ case WOKUtils_LIBFile:
+ if(!path->BaseName()->IsSameString(Unit()->Name()))
+ res = new WOKBuilder_StaticLibrary(path);
+ else
+ return Standard_False;
+ break;
+ case WOKUtils_IMPFile:
+ res = new WOKBuilder_ImportLibrary(path);
+ break;
+ case WOKUtils_EXPFile:
+ res = new WOKBuilder_ExportLibrary(path);
+ break;
+ case WOKUtils_DEFile:
+ if(path->BaseName()->IsSameString(Unit()->Name()))
+ res = new WOKBuilder_DEFile(path);
+ else
+ return Standard_False;
+ break;
+ default:
+ return Standard_False;
+ }
+
+ anItem->SetBuilderEntity(res);
+ anItem->SetDirectFlag(Standard_True);
+
+ return Standard_True;
+ }
+ else if (!anItem->IsPhysic())
+ return Standard_True;
+ return Standard_False;
+
+}
+
+
+//=======================================================================
+//function : ComputeExternals
+//purpose :
+//=======================================================================
+Handle(TColStd_HSequenceOfHAsciiString) WOKStep_WNTLink::ComputeExternals(const Handle(WOKMake_HSequenceOfInputFile)& execlist)
+{
+ Standard_Integer i;
+ Handle(TColStd_HSequenceOfHAsciiString) externals = new TColStd_HSequenceOfHAsciiString;
+
+ for(i=1; i<=execlist->Length(); i++)
+ {
+ Handle(WOKMake_InputFile) infile = execlist->Value(i);
+
+ if(!infile->IsPhysic())
+ {
+ if(!strcmp("external", infile->ID()->Token(":", 2)->ToCString()))
+ {
+ Handle(TCollection_HAsciiString) astr = new TCollection_HAsciiString("%");
+ astr->AssignCat(infile->ID()->Token(":", 3));
+
+ Handle(TCollection_HAsciiString) external = Unit()->Params().Eval(astr->ToCString());
+
+ if(external.IsNull())
+ {
+ WarningMsg << "WOKStep_WNTLink::ComputeExternals"
+ << "Skipped external " << infile->ID()->Token(":", 3) << "; could not eval : " << astr << endm;
+ }
+ else
+ {
+ externals->Append(external);
+ }
+ }
+ }
+ }
+ return externals;
+}
+
+
+//=======================================================================
+//function : Execute
+//purpose :
+//=======================================================================
+void WOKStep_WNTLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& anExecList)
+{
+#ifdef WNT
+
+ Handle(WOKBuilder_DEFile) defFile;
+ Handle(WOKBuilder_ExportLibrary) expLib;
+ Handle(WOKernel_FileType) libType;
+
+
+ if(IsKind(STANDARD_TYPE(WOKStep_DLLink)))
+ {
+ libType = Unit()->GetFileType("library");
+ }
+ else if(IsKind(STANDARD_TYPE(WOKStep_EXELink)))
+ {
+ libType = Unit()->GetFileType("executable");
+ }
+
+ if(libType.IsNull())
+ {
+ WarningMsg << "WOKStep_WNTLink::Execute"
+ << "Unknown link : library is produced" << endm;
+ libType = Unit()->GetFileType("library");
+ }
+
+ Handle(WOKBuilder_WNTLinker) tool = Handle(WOKBuilder_WNTLinker)::DownCast(ComputeTool());
+
+ myTarget = new TCollection_HAsciiString(OutputDir()->Name());
+
+ myTarget->AssignCat(SubCode().IsNull() ? Unit()->Name() : SubCode());
+
+ tool->SetTargetName(myTarget);
+
+ Unit()->Params().Set("%DebugMode",Unit()->Session()->DebugMode() ? "True" : "False");
+
+ Handle(TCollection_HAsciiString) exetype = Unit()->Params().Eval("%LINK_ExeType");
+
+ if(exetype.IsNull())
+ {
+ Unit()->Params().Set("%LinkSubsystem", "CONSOLE");
+ }
+ else
+ {
+ Unit()->Params().Set("%LinkSubsystem", exetype->ToCString());
+ }
+
+ if(!tool->OpenCommandFile())
+ {
+ SetFailed();
+ return;
+ }
+
+ tool->ProduceObjectList(ComputeObjectList(anExecList));
+ tool->ProduceLibraryList(ComputeLibraryList(anExecList));
+ tool->ProduceExternList(ComputeExternals(anExecList));
+
+ for(int i = 1; i <= anExecList->Length(); ++i)
+ {
+ defFile = Handle(WOKBuilder_DEFile)::DownCast(anExecList->Value(i)->BuilderEntity());
+
+ if(!defFile.IsNull())
+ {
+ tool->ProduceDEFile(defFile);
+ break;
+ }
+ }
+
+ if(WOKernel_IsToolkit(Unit()))
+ {
+ for(int i = 1; i <= anExecList->Length(); ++i)
+ {
+ expLib = Handle(WOKBuilder_ExportLibrary)::DownCast(anExecList->Value(i)->BuilderEntity());
+
+ if(!expLib.IsNull())
+ {
+ Handle(WOKBuilder_HSequenceOfLibrary) expSeq = new WOKBuilder_HSequenceOfLibrary();
+
+ expSeq->Append(expLib);
+ tool->ProduceLibraryList(expSeq);
+ break;
+
+ }
+ }
+ }
+
+ if(!WOKernel_IsExecutable(Unit()))
+ {
+ DWORD dwLen;
+ Handle(TCollection_HAsciiString) stubName;
+ Handle(TCollection_HAsciiString) buff;
+ Handle(TColStd_HSequenceOfHAsciiString) seq = new TColStd_HSequenceOfHAsciiString;
+
+ Handle(TCollection_HAsciiString) nodefstub = Unit()->Params().Eval("%LINK_NoDefStub");
+
+ if(nodefstub.IsNull())
+ {
+ stubName = Unit()->Params().Eval(WOKernel_IsToolkit(Unit()) ? "%STUBS_tkMain" : "%STUBS_uMain");
+ dwLen = ExpandEnvironmentStrings(stubName->ToCString(), NULL, 0);
+
+ char* buffer = (char *) aStorageManager.Allocate(dwLen+1);
+ memset(buffer, 0, dwLen+1);
+
+ ExpandEnvironmentStrings(stubName->ToCString(), buffer, dwLen);
+ buff = new TCollection_HAsciiString(buffer);
+
+ aStorageManager.Free((void*&)buffer,dwLen+1);
+ seq->Append(buff);
+
+ }
+
+ stubName = Unit()->Params().Eval("%STUBS_Library");
+
+ dwLen = ExpandEnvironmentStrings(stubName->ToCString(), NULL, 0);
+
+ char* buffer = (char *) aStorageManager.Allocate(dwLen+1);
+ memset(buffer, 0, dwLen+1);
+
+ ExpandEnvironmentStrings(stubName->ToCString(), buffer, dwLen);
+
+ buff = new TCollection_HAsciiString(buffer);
+ aStorageManager.Free((void*&)buffer,dwLen+1);
+ seq->Append(buff);
+
+
+ if(WOKernel_IsToolkit(Unit()))
+ {
+
+
+ Handle(WOKernel_File) stubFile = new WOKernel_File(Unit()->Session()->DebugMode() ?
+ new TCollection_HAsciiString("_debug_stub.obj")
+ : new TCollection_HAsciiString("_release_stub.obj"),
+ Unit(),
+ Unit()->GetFileType("object"));
+
+ stubFile->GetPath();
+ Unit()->Params().Set("%StubDir", stubFile->Path()->DirName()->ToCString());
+
+ Handle(TCollection_HAsciiString) stubName = Unit()->Params().Eval("STUBS_FileNameDst");
+
+ if(!stubName.IsNull()) seq->Append(stubName);
+ }
+
+ tool->ProduceExternList(seq);
+ }
+
+ if(!tool->CloseCommandFile())
+ {
+ SetFailed();
+ return;
+ }
+
+ tool->SetShell(Shell());
+
+ switch(tool->Execute())
+ {
+ case WOKBuilder_Success:
+ {
+ Handle(WOKernel_File ) libPath;
+ Handle(WOKBuilder_Entity) outEnt;
+ Handle(WOKMake_OutputFile) outFile;
+
+ for(int i = 1; i <= tool->Produces()->Length(); ++i)
+ {
+ outEnt = tool->Produces()->Value(i);
+
+ if(outEnt->Path()->Exists())
+ {
+ if(outEnt->IsKind(STANDARD_TYPE(WOKBuilder_ExportLibrary)))
+ {
+ outEnt->Path()->RemoveFile();
+ continue;
+ }
+
+ libPath = new WOKernel_File(outEnt->Path()->FileName(), Unit(), libType);
+
+ libPath->GetPath();
+
+ outEnt->Path()->MoveTo(libPath->Path());
+dummyStepFile:
+ outFile = new WOKMake_OutputFile(libPath->LocatorName(), libPath, outEnt, libPath->Path());
+
+ outFile->SetLocateFlag(Standard_True);
+ outFile->SetProduction();
+
+ for(int j = 1; j <= anExecList->Length(); ++j)
+ AddExecDepItem(anExecList->Value(j), outFile, Standard_True);
+
+ }
+ else if(WOKernel_IsToolkit(Unit()) && outEnt->Path()->Extension() == WOKUtils_LIBFile)
+ {
+ libPath = new WOKernel_File(outEnt->Path()->FileName(), Unit(), libType);
+ libPath->GetPath();
+ goto dummyStepFile;
+ }
+ }
+ SetSucceeded();
+ }
+ break;
+ case WOKBuilder_Failed:
+ SetFailed();
+ break;
+ }
+
+ InfoMsg << "WOKStep_WNTLink::Execute"
+ << "------------" << endm << "" << endm;
+
+#else
+ ErrorMsg << "WOKStep_WNTLink::Execute"
+ << "Step WOKStep_WNTLink is available only on WNT platforms." << endm;
+ SetFailed();
+#endif // WNT
+}
--- /dev/null
+
+proc WOKStep_ccl::AdmFileType {} {
+
+ return admfile;
+}
+
+proc WOKStep_ccl::OutputDirTypeName {} {
+ return tmpdir;
+}
+
+proc WOKStep_ccl::HandleInputFile { ID } {
+
+ scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name
+
+ switch [file extension $name] {
+ .ccl {
+ return 1;
+ }
+ .us {
+ return 1;
+ }
+ .fr {
+ return 1;
+ }
+ .ja {
+ return 1;
+ }
+ default {
+ return 0;
+ }
+ }
+}
+
+proc WOKStep_ccl::Execute { unit args } {
+
+ msgprint -i -c "WOKStep_ccl::Execute" "Processing unit : $unit"
+ msgprint -i -c "WOKStep_ccl::Execute"
+
+ set unitname [wokinfo -n $unit]
+ set targetid "$unitname:ccldrv:$unitname.ccl"
+ set target [wokinfo -p ccldrv:$unitname.ccl $unit]
+
+ catch {unset tab}
+ catch {unset idtab}
+ catch {unset tabmess}
+ catch {unset idtabmess}
+
+ foreach ID $args {
+ scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name
+ set ext [file extension $name]
+ if {$ext == ".ccl"} {
+ lappend idtab($ext) $ID
+ lappend tab($ext) [woklocate -p $ID $unit]
+ } else {
+ if {[string match "*_Msg$ext" $name]} {
+ lappend idtabmess($ext) $ID
+ lappend tabmess($ext) [woklocate -p $ID $unit]
+ } else {
+ lappend idtab($ext) $ID
+ lappend tab($ext) [woklocate -p $ID $unit]
+ }
+ }
+ }
+
+ foreach l [array names tab] {
+
+ if {$l == ".ccl"} {
+ set res [wokinfo -p ccldrv:$unitname${l} $unit ]
+ set resid $unitname:ccldrv:$unitname${l}
+ } else {
+ set res [wokinfo -p msgfile:$unitname${l} $unit ]
+ set resid $unitname:msgfile:$unitname${l}
+ }
+
+ msgprint -i "Creating $res"
+ if [file exists $res ] {
+ unlink $res
+ }
+
+ foreach file $tab($l) {
+ msgprint -i "Adding $file"
+ }
+
+ wokUtils:FILES:concat $res $tab($l)
+
+ stepoutputadd -M -P -L -F $resid
+
+ foreach id $idtab($l) {
+ stepaddexecdepitem -d $id $resid
+ }
+
+ foreach id $idtab($l) {
+ stepaddexecdepitem -d $id $resid
+ }
+
+ }
+
+ foreach l [array names tabmess] {
+
+ set res [wokinfo -p msgfile:${unitname}_Msg${l} $unit ]
+ set resid $unitname:msgfile:${unitname}_Msg${l}
+
+ msgprint -i "Creating $res"
+ if [file exists $res ] {
+ unlink $res
+ }
+
+ foreach file $tabmess($l) {
+ msgprint -i "Adding $file"
+ }
+
+ wokUtils:FILES:concat $res $tabmess($l)
+
+ stepoutputadd -M -P -L -F $resid
+
+ foreach id $idtabmess($l) {
+ stepaddexecdepitem -d $id $resid
+ }
+
+ foreach id $idtabmess($l) {
+ stepaddexecdepitem -d $id $resid
+ }
+
+ }
+
+
+ return 0;
+}
--- /dev/null
+
+proc WOKStep_frontal::AdmFileType {} {
+ return stadmfile;
+}
+
+proc WOKStep_frontal::OutputDirTypeName {} {
+ return sttmpdir;
+}
+
+proc WOKStep_frontal::HandleInputFile { ID } {
+ return 1;
+}
+
+
+proc WOKStep_frontal::ExecuteOldFrontal {unit args} {
+ global WOK_GLOBALS
+
+ set pk [wokinfo -n $unit]
+ set nameFROMFRONT [woklocate -p ${pk}:source:FROM_FRONTAL]
+ if {[clength $nameFROMFRONT] == 0} {
+ msgprint -e "Unable to locate file FROM_FRONTAL"
+ return 1
+ }
+ set nameCOMP [woklocate -p ${pk}:source:COMPONENTS]
+ if {[clength $nameCOMP] == 0} {
+ msgprint -e "Unable to locate file COMPONENTS"
+ return 1
+ }
+
+ set wb [wokinfo -N $unit]
+
+ set dir [file dirname [wokinfo -p sttmpfile:missing $unit]]
+
+ set savpwd [pwd]
+ cd $dir
+
+
+ set bin [wokUtils:FILES:FileToList $nameFROMFRONT]
+
+ set from [woklocate -p ${bin}:executable:lelisp.bin $wb]
+ set fromid ${bin}:executable:lelisp.bin
+ if { $from == {} } {
+ set from [woklocate -p CCL:executable:lelisp.bin $wb]
+ set fromid CCL:executable:lelisp.bin
+ if { $from == {}} {
+ msgprint -e "Unable to locate the file lelisp.bin."
+ cd $savpwd
+ return 1
+ }
+ }
+
+ set exec [woklocate -p ${bin}:executable:${bin} $wb]
+ if { $exec == {} } {
+ msgprint -e "Unable to locate the frontal file $bin"
+ cd $savpwd
+ return 1
+ }
+
+ msgprint -i "Copying binary file Lelisp from ${bin}"
+ if [catch {eval "exec cp $from [pwd]"} res] {
+ msgprint -e -c "WOKStep_frontal::Execute" $res
+ return 1
+ }
+
+ if [file exists tmp.ccl] {
+ unlink tmp.ccl
+ }
+
+ set failed 0
+ set l {}
+ foreach ccl [wokUtils:FILES:FileToList $nameCOMP] {
+ set f [woklocate -p ${ccl}:ccldrv:${ccl}.ccl $wb]
+ set m [woklocate -p ${ccl}:msgfile:${ccl}.us $wb]
+ if { $f != {} } {
+ lappend l [format "(load \"%s\")" $f]
+ } {
+ msgprint -e "Could not locate file : ${ccl}:ccldrv:${ccl}.ccl"
+ }
+ if { $m != {} } {
+ lappend l [format "(load-message \"%s\")" $m]
+ }
+ }
+
+ if $failed {return 1}
+
+ if { $l != {} } {
+ lappend l [format "(make-exec \"%s\" \"%s\" )" $dir $pk]
+ lappend l [format "(end)"]
+ wokUtils:FILES:ListToFile $l tmp.ccl
+ } else {
+ msgprint -e "Empty file COMPONENTS"
+ return 1
+ }
+
+ msgprint -i "Setting Environnement"
+ set WOK_GLOBALS(setenv_proc,tcl) 1
+ wokenv -s
+ set WOK_GLOBALS(setenv_proc,tcl) 0
+
+ set licensefile [woklocate -p CCLFrontal:datafile:[wokparam -e %Ilog_File] $wb]
+
+ if { $licensefile == "" } {
+ msgprint -c "WOKStep_frontal::Execute" -e "Unable to locate the Ilog license file"
+ return 1;
+ }
+
+ msgprint -c "WOKStep_frontal::Execute" -i "Building $pk"
+
+ if [catch {eval "exec /bin/env ILOG_LICENSE_FILE=$licensefile $exec -f tmp.ccl << (end)"} result] {
+ msgprint -e "$result"
+ }
+
+ set resexe [wokinfo -p executable:$pk $unit]
+ set rescore [wokinfo -p corelisp:${pk}.core $unit]
+
+ msgprint -i -c "WOKStep_frontal::Execute" "Updating $resexe"
+ wokparam -s "%LeLispFile=$from"
+ wokparam -s "%CoreFile=$rescore"
+
+ set thecommand [wokparam -e FRONTAL_FrontalScript]
+
+ if {[catch {set fidexe [open $resexe "w"]} res] == 0} {
+ puts $fidexe [lindex $thecommand 0]
+ close $fidexe
+ chmod 0755 $resexe
+ } else {
+ msgprint -e -c "WOKStep_frontal::Execute" "Enable to generate $rescore"
+ msgprint -e -c "WOKStep_frontal::Execute" $res
+
+ return 1
+ }
+
+ msgprint -i -c "WOKStep_frontal::Execute" "Updating $rescore"
+ if [catch {eval "exec cp $pk.core $rescore"} result] {
+ msgprint -e -c "WOKStep_frontal::Execute" $result
+ }
+
+
+ # insert dependencies
+
+ stepinputadd ${bin}:executable:${bin}
+
+ stepinputadd $fromid
+
+ stepoutputadd -M -P -L -F $pk:executable:$pk
+
+ stepaddexecdepitem -d ${bin}:executable:${bin} $pk:executable:$pk
+
+ stepaddexecdepitem -d $fromid $pk:executable:$pk
+
+ stepaddexecdepitem -d ${pk}:source:FROM_FRONTAL $pk:executable:$pk
+
+ stepoutputadd -M -P -L -F $pk:corelisp:${pk}.core
+
+ stepaddexecdepitem -d $fromid $pk:corelisp:${pk}.core
+
+ stepaddexecdepitem -d ${pk}:source:FROM_FRONTAL $pk:corelisp:${pk}.core
+
+ foreach ccl [wokUtils:FILES:FileToList $nameCOMP] {
+ set f [woklocate -p ${ccl}:ccldrv:${ccl}.ccl $wb]
+ if { $f != {} } {
+ stepinputadd ${ccl}:ccldrv:${ccl}.ccl
+ stepaddexecdepitem -d ${ccl}:ccldrv:${ccl}.ccl $pk:corelisp:${pk}.core
+ }
+ }
+
+ cd $savpwd
+ return 0;
+}
+
+
+
+
+proc WOKStep_frontal::ExecuteNewFrontal { unit args } {
+ global WOK_GLOBALS
+
+ set pk [wokinfo -n $unit]
+ set nameFROMFRONT [woklocate -p ${pk}:source:FROM_FRONTAL]
+ if {[clength $nameFROMFRONT] == 0} {
+ msgprint -e "Unable to locate file FROM_FRONTAL"
+ return 1
+ }
+ set nameCOMP [woklocate -p ${pk}:source:COMPONENTS]
+ if {[clength $nameCOMP] == 0} {
+ msgprint -e "Unable to locate file COMPONENTS"
+ return 1
+ }
+
+
+
+ set wb [wokinfo -N $unit]
+
+ set fileout [wokinfo -p ccldrv:${pk}.ccl $unit]
+
+ msgprint -i "Creating $fileout"
+ if [file exists $fileout ] {
+ unlink $fileout
+ }
+
+
+ set idout [open $fileout "w"]
+ puts $idout ";; CCL Frontal -> $pk "
+ close $idout
+
+ stepoutputadd -M -P -L -F ${pk}:ccldrv:${pk}.ccl
+
+ set fromunit [wokUtils:FILES:FileToList $nameFROMFRONT]
+
+ if {$fromunit == "CCLKernel"} {
+
+ msgprint -i "Switch CCLKernel to KernelFrontal"
+
+ set fromunit "KernelFrontal"
+ }
+
+
+ if {$fromunit != {}} {
+
+ set f [woklocate -p ${fromunit}:ccldrv:${fromunit}.ccl $wb]
+
+ if { $f != {} } {
+ wokUtils:FILES:concat $fileout $f
+ stepinputadd ${fromunit}:ccldrv:${fromunit}.ccl
+ stepaddexecdepitem -d ${fromunit}:ccldrv:${fromunit}.ccl ${pk}:ccldrv:${pk}.ccl
+ } else {
+ msgprint -w "Could not locate file : ${fromunit}:ccldrv:${fromunit}.ccl"
+ }
+ }
+
+
+ foreach ccl [wokUtils:FILES:FileToList $nameCOMP] {
+ set f [woklocate -p ${ccl}:ccldrv:${ccl}.ccl $wb]
+ if { $f != {} } {
+ wokUtils:FILES:concat $fileout $f
+ stepinputadd ${ccl}:ccldrv:${ccl}.ccl
+ stepaddexecdepitem -d ${ccl}:ccldrv:${ccl}.ccl ${pk}:ccldrv:${pk}.ccl
+ } else {
+ msgprint -e "Could not locate file : ${ccl}:ccldrv:${ccl}.ccl"
+ }
+ }
+
+ if {[wokparam -e %Station] == "wnt"} {
+ set execid CCL${pk}.cmd
+ } else {
+ set execid CCL${pk}
+ }
+
+
+ set resexe [wokinfo -p executable:$execid $unit]
+
+ set fileoutmsg [wokinfo -p cmpmsgfile:${pk}_Cmp.us $unit]
+ set fileoutoldmsg [wokinfo -p msgfile:${pk}.us $unit]
+
+ msgprint -i -c "WOKStep_frontal::Execute" "Updating $resexe"
+ wokparam -s "%CCLFile=$fileout"
+ wokparam -s "%MsgCmpFile=$fileoutmsg"
+ wokparam -s "%MsgFile=$fileoutoldmsg"
+
+ set thecommand [wokparam -e FRONTAL_CCLScript]
+
+ if {[catch {set fidexe [open $resexe "w"]} res] == 0} {
+ puts $fidexe [lindex $thecommand 0]
+ close $fidexe
+ if {[wokparam -e %Station] != "wnt"} {
+ chmod 0755 $resexe
+ }
+ } else {
+ msgprint -e -c "WOKStep_frontal::Execute" "Enable to generate $rescore"
+ msgprint -e -c "WOKStep_frontal::Execute" $res
+
+ return 1
+ }
+ # insert dependencies
+
+ stepinputadd ${pk}:source:FROM_FRONTAL
+
+ stepinputadd ${pk}:source:COMPONENTS
+
+ stepoutputadd ${pk}:executable:$execid
+
+ stepaddexecdepitem -d ${pk}:source:FROM_FRONTAL ${pk}:executable:$execid
+
+ stepaddexecdepitem -d ${pk}:source:COMPONENTS ${pk}:executable:$execid
+
+ stepaddexecdepitem -d ${pk}:source:FROM_FRONTAL ${pk}:ccldrv:${pk}.ccl
+
+ stepaddexecdepitem -d ${pk}:source:COMPONENTS ${pk}:ccldrv:${pk}.ccl
+
+ return 0;
+}
+
+proc WOKStep_frontal::ExecuteMessages { unit args } {
+
+ set pk [wokinfo -n $unit]
+
+ set wb [wokinfo -N $unit]
+
+ set nameFROMFRONT [woklocate -p ${pk}:source:FROM_FRONTAL]
+
+ set nameMESS [woklocate -p ${pk}:source:MESSAGES]
+
+ set nameCOMP [woklocate -p ${pk}:source:COMPONENTS]
+
+ set hasmess 1
+
+ if {[clength $nameMESS] == 0} {
+ msgprint -i "Unable to locate file MESSAGES"
+ msgprint -i "No messages compilation done"
+ msgprint -i "Catenate message files"
+ set hasmess 0
+
+ }
+
+ set fileoutmsg [wokinfo -p tmpfile:${pk}.us $unit]
+
+ if {$hasmess == 0} {
+ set fileoutmess [wokinfo -p msgfile:${pk}.us $unit]
+ } else {
+ set fileoutmess [wokinfo -p msgfile:${pk}_Msg.us $unit]
+ }
+
+ if {![file exists $fileoutmess]} {
+ set idoutmsg [open $fileoutmess "w"]
+ puts $idoutmsg " "
+ close $idoutmsg
+ }
+
+ stepinputadd ${pk}:source:COMPONENTS
+ if {$hasmess == 0} {
+ stepoutputadd -M -P -L -F ${pk}:msgfile:${pk}.us
+ stepaddexecdepitem -d ${pk}:source:COMPONENTS ${pk}:msgfile:${pk}.us
+ } else {
+ stepoutputadd -M -P -L -F ${pk}:msgfile:${pk}_Msg.us
+ stepaddexecdepitem -d ${pk}:source:COMPONENTS ${pk}:msgfile:${pk}_Msg.us
+ }
+
+
+ if [file exists $fileoutmsg ] {
+ unlink $fileoutmsg
+ }
+
+ set idoutmsg [open $fileoutmsg "w"]
+ if {$hasmess} {
+ puts $idoutmsg "! Messages -> $pk "
+ } else {
+ puts $idoutmsg ";; CCL Messages -> $pk "
+ }
+
+ close $idoutmsg
+
+ set fromunit [wokUtils:FILES:FileToList $nameFROMFRONT]
+
+ if {$fromunit != {}} {
+
+ if {$hasmess == 0} {
+ set f [woklocate -p ${fromunit}:msgfile:${fromunit}.us $wb]
+ } else {
+ set f [woklocate -p ${fromunit}:msgfile:${fromunit}_Msg.us $wb]
+ }
+
+ if { $f != {} } {
+ wokUtils:FILES:concat $fileoutmsg $f
+ if {$hasmess == 0} {
+ stepinputadd ${fromunit}:msgfile:${fromunit}.us
+ stepaddexecdepitem -d ${fromunit}:msgfile:${fromunit}.us ${pk}:msgfile:${pk}.us
+ } else {
+ stepinputadd ${fromunit}:msgfile:${fromunit}_Msg.us
+ stepaddexecdepitem -d ${fromunit}:msgfile:${fromunit}_Msg.us ${pk}:msgfile:${pk}_Msg.us
+ }
+ } else {
+ if {$hasmess} {
+ msgprint -w "Could not locate file : ${fromunit}:msgfile:${fromunit}_Msg.us"
+ } else {
+ msgprint -w "Could not locate file : ${fromunit}:msgfile:${fromunit}.us"
+ }
+ }
+ }
+
+ foreach ccl [wokUtils:FILES:FileToList $nameCOMP] {
+ if {$hasmess == 0} {
+ set f [woklocate -p ${ccl}:msgfile:${ccl}.us $wb]
+ } else {
+ set f [woklocate -p ${ccl}:msgfile:${ccl}_Msg.us $wb]
+ }
+ if { $f != {} } {
+ wokUtils:FILES:concat $fileoutmsg $f
+ if {$hasmess == 0} {
+ stepinputadd ${ccl}:msgfile:${ccl}.us
+ stepaddexecdepitem -d ${ccl}:msgfile:${ccl}.us ${pk}:msgfile:${pk}.us
+ } else {
+ stepinputadd ${ccl}:msgfile:${ccl}_Msg.us
+ stepaddexecdepitem -d ${ccl}:msgfile:${ccl}_Msg.us ${pk}:msgfile:${pk}_Msg.us
+ }
+ } else {
+ if {$hasmess} {
+ msgprint -w "Could not locate file : ${ccl}:msgfile:${ccl}_Msg.us"
+ } else {
+ msgprint -w "Could not locate file : ${ccl}:msgfile:${ccl}.us"
+ }
+ }
+ }
+
+ if {$hasmess} {
+ foreach mesunit [wokUtils:FILES:FileToList $nameMESS] {
+ set f [woklocate -p ${mesunit}:msgfile:${mesunit}_Msg.us $wb]
+ if { $f != {} } {
+ wokUtils:FILES:concat $fileoutmsg $f
+ stepinputadd ${mesunit}:msgfile:${mesunit}_Msg.us
+ stepaddexecdepitem -d ${mesunit}:msgfile:${mesunit}_Msg.us ${pk}:msgfile:${pk}_Msg.us
+ } else {
+ msgprint -w "Could not locate file : ${mesunit}:msgfile:${mesunit}_Msg.us"
+ }
+ }
+ }
+
+ set torecompute 0
+ if {![wokUtils:FILES:AreSame $fileoutmsg $fileoutmess]} {
+ msgprint -i "Modifying $fileoutmess"
+ wokUtils:FILES:copy $fileoutmsg $fileoutmess
+ set torecompute 1
+ }
+ if {[clength [woklocate -p ${pk}:cmpmsgfile:${pk}_Cmp.us]] == 0} {
+ set torecompute 1
+ }
+ if {$hasmess} {
+ if {$torecompute} {
+ msgprint -i "Compiling messages"
+ set msgtoolname "MsgBuild"
+ if {[wokparam -e %Station] == "wnt"} {
+ set msgtoolname "MsgBuild.exe"
+ }
+ set msgtool [woklocate -p MsgUtil:executable:${msgtoolname}]
+ set resmsg [wokinfo -p cmpmsgfile:${pk}_Cmp.us $unit]
+ if {![catch {eval "exec $msgtool $resmsg $fileoutmess"} errorinmsg ]} {
+ msgprint -e $errorinmsg
+ unlink $fileoutmess
+ return 1
+ }
+ }
+ stepoutputadd -M -P -L -F ${pk}:cmpmsgfile:${pk}_Cmp.us
+ stepaddexecdepitem -d ${pk}:source:COMPONENTS ${pk}:cmpmsgfile:${pk}_Cmp.us
+ }
+ return 0
+}
+
+proc WOKStep_frontal::Execute { unit args } {
+
+ set pk [wokinfo -n $unit]
+ set resold 0
+ catch {
+ if {$pk != "KernelFrontal"} {
+ if {[wokparam -e %Station] != "wnt"} {
+ set resold [WOKStep_frontal::ExecuteOldFrontal $unit $args]
+ }
+ }
+ }
+ set resnew [WOKStep_frontal::ExecuteNewFrontal $unit $args]
+
+ set resmes [WOKStep_frontal::ExecuteMessages $unit $args]
+
+ return [expr [expr $resold && $resnew] || $resmes]
+}