Check automatic dependencies of referenced object library modules on
make <module>_depends
Modified: trunk/reactos/tools/rbuild/automaticdependency.cpp
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
Modified: trunk/reactos/tools/rbuild/module.cpp
Modified: trunk/reactos/tools/rbuild/rbuild.h
_____
Modified: trunk/reactos/tools/rbuild/automaticdependency.cpp
--- trunk/reactos/tools/rbuild/automaticdependency.cpp 2005-07-08
19:51:37 UTC (rev 16512)
+++ trunk/reactos/tools/rbuild/automaticdependency.cpp 2005-07-08
19:55:30 UTC (rev 16513)
@@ -11,7 +11,7 @@
using std::map;
SourceFile::SourceFile ( AutomaticDependency* automaticDependency,
- Module& module,
+ const Module& module,
const string& filename,
SourceFile* parent,
bool isNonAutomaticDependency )
@@ -294,7 +294,7 @@
}
void
-AutomaticDependency::GetModuleFiles ( Module& module,
+AutomaticDependency::GetModuleFiles ( const Module& module,
vector<File*>& files ) const
{
for ( size_t i = 0; i < module.non_if_data.files.size (); i++ )
@@ -307,7 +307,7 @@
}
void
-AutomaticDependency::ParseFiles ( Module& module )
+AutomaticDependency::ParseFiles ( const Module& module )
{
vector<File*> files;
GetModuleFiles ( module, files );
@@ -316,7 +316,7 @@
}
void
-AutomaticDependency::ParseFile ( Module& module,
+AutomaticDependency::ParseFile ( const Module& module,
const File& file )
{
string normalizedFilename = NormalizeFilename ( file.name );
@@ -355,7 +355,7 @@
void
AutomaticDependency::GetIncludeDirectories ( vector<Include*>&
includes,
- Module& module,
+ const Module& module,
Include& currentDirectory,
bool
searchCurrentDirectory )
{
@@ -369,7 +369,7 @@
bool
AutomaticDependency::LocateIncludedFile ( SourceFile* sourceFile,
- Module& module,
+ const Module& module,
const string&
includedFilename,
bool searchCurrentDirectory,
bool includeNext,
@@ -396,9 +396,9 @@
}
SourceFile*
-AutomaticDependency::RetrieveFromCacheOrParse ( Module& module,
- const string&
filename,
- SourceFile*
parentSourceFile )
+AutomaticDependency::RetrieveFromCacheOrParse ( const Module& module,
+ const string& filename,
+ SourceFile*
parentSourceFile )
{
SourceFile* sourceFile = sourcefile_map[filename];
if ( sourceFile == NULL )
@@ -429,25 +429,41 @@
for ( size_t mi = 0; mi < project.modules.size (); mi++ )
{
Module& module = *project.modules[mi];
- CheckAutomaticDependencies ( module, verbose, false );
+ CheckAutomaticDependencies ( module, verbose );
}
}
void
-AutomaticDependency::CheckAutomaticDependencies ( Module& module,
- bool verbose )
+AutomaticDependency::GetModulesToCheck ( Module& module, vector<const
Module*>& modules )
{
- CheckAutomaticDependencies ( module, verbose, true );
+ modules.push_back ( &module );
+ for ( size_t i = 0; i < module.non_if_data.libraries.size ();
i++ )
+ {
+ Library& library = *module.non_if_data.libraries[i];
+ if ( library.importedModule->type != ObjectLibrary )
+ break;
+ modules.push_back ( library.importedModule );
+ }
+
+ /* FIXME: Collect libraries in IFs here */
}
void
-AutomaticDependency::CheckAutomaticDependencies ( Module& module,
- bool verbose,
- bool parseFiles )
+AutomaticDependency::CheckAutomaticDependenciesForModule ( Module&
module,
+ bool verbose
)
{
- if ( parseFiles )
- ParseFiles ( module );
+ vector<const Module*> modules;
+ GetModulesToCheck ( module, modules );
+ for ( size_t mi = 0; mi < modules.size (); mi++ )
+ ParseFiles ( *modules[mi] );
+ for ( size_t mi = 0; mi < modules.size (); mi++ )
+ CheckAutomaticDependencies ( *modules[mi], verbose );
+}
+void
+AutomaticDependency::CheckAutomaticDependencies ( const Module& module,
+ bool verbose )
+{
struct utimbuf timebuf;
vector<File*> files;
GetModuleFiles ( module, files );
_____
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-07-08
19:51:37 UTC (rev 16512)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp 2005-07-08
19:55:30 UTC (rev 16513)
@@ -325,8 +325,8 @@
printf ( "Checking automatic dependencies for module
'%s'...",
module->name.c_str () );
AutomaticDependency automaticDependency ( ProjectNode );
- automaticDependency.CheckAutomaticDependencies (
*module,
-
configuration.Verbose );
+ automaticDependency.CheckAutomaticDependenciesForModule
( *module,
+
configuration.Verbose );
printf ( "done\n" );
}
}
_____
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
2005-07-08 19:51:37 UTC (rev 16512)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
2005-07-08 19:55:30 UTC (rev 16513)
@@ -615,7 +615,7 @@
dependencies += " \\\n\t\t", wrap_count = 0;
else if ( dependencies.size () > 0 )
dependencies += " ";
- dependencies += GetImportLibraryDependency (
*libraries[i]->imported_module );
+ dependencies += GetImportLibraryDependency (
*libraries[i]->importedModule );
}
return dependencies;
}
@@ -1274,7 +1274,7 @@
void
MergeStringVector ( const vector<string>& input,
- vector<string>& output )
+ vector<string>& output )
{
int wrap_at = 25;
string s;
@@ -1603,20 +1603,20 @@
for ( size_t i = 0; i < module.non_if_data.libraries.size ();
i++ )
{
Library& library = *module.non_if_data.libraries[i];
- if ( library.imported_module->type == RpcServer ||
- library.imported_module->type == RpcClient )
+ if ( library.importedModule->type == RpcServer ||
+ library.importedModule->type == RpcClient )
{
- for ( size_t j = 0; j <
library.imported_module->non_if_data.files.size (); j++ )
+ for ( size_t j = 0; j <
library.importedModule->non_if_data.files.size (); j++ )
{
- File& file =
*library.imported_module->non_if_data.files[j];
+ File& file =
*library.importedModule->non_if_data.files[j];
string extension = GetExtension (
file.name );
if ( extension == ".idl" || extension ==
".IDL" )
{
string basename = GetBasename (
file.name );
- if (
library.imported_module->type == RpcServer )
+ if (
library.importedModule->type == RpcServer )
dependencies.push_back (
GetRpcServerHeaderFilename ( basename ) );
- if (
library.imported_module->type == RpcClient )
+ if (
library.importedModule->type == RpcClient )
dependencies.push_back (
GetRpcClientHeaderFilename ( basename ) );
}
}
_____
Modified: trunk/reactos/tools/rbuild/module.cpp
--- trunk/reactos/tools/rbuild/module.cpp 2005-07-08 19:51:37 UTC
(rev 16512)
+++ trunk/reactos/tools/rbuild/module.cpp 2005-07-08 19:55:30 UTC
(rev 16513)
@@ -817,14 +817,14 @@
: node(_node),
module(_module),
name(_name),
- imported_module(_module.project.LocateModule(_name))
+ importedModule(_module.project.LocateModule(_name))
{
if ( module.name == name )
throw InvalidBuildFileException (
node.location,
"module '%s' cannot link against itself",
name.c_str() );
- if ( !imported_module )
+ if ( !importedModule )
throw InvalidBuildFileException (
node.location,
"module '%s' trying to import non-existant
module '%s'",
_____
Modified: trunk/reactos/tools/rbuild/rbuild.h
--- trunk/reactos/tools/rbuild/rbuild.h 2005-07-08 19:51:37 UTC (rev
16512)
+++ trunk/reactos/tools/rbuild/rbuild.h 2005-07-08 19:55:30 UTC (rev
16513)
@@ -316,7 +316,7 @@
const XMLElement& node;
const Module& module;
std::string name;
- const Module* imported_module;
+ const Module* importedModule;
Library ( const XMLElement& _node,
const Module& _module,
@@ -533,7 +533,7 @@
{
public:
SourceFile ( AutomaticDependency* automaticDependency,
- Module& module,
+ const Module& module,
const std::string& filename,
SourceFile* parent,
bool isNonAutomaticDependency );
@@ -542,7 +542,7 @@
std::string Location () const;
std::vector<SourceFile*> files;
AutomaticDependency* automaticDependency;
- Module& module;
+ const Module& module;
std::string filename;
std::string filenamePart;
std::string directoryPart;
@@ -584,32 +584,32 @@
const std::string& includedFilename,
std::string& resolvedFilename );
bool LocateIncludedFile ( SourceFile* sourceFile,
- Module& module,
+ const Module& module,
const std::string& includedFilename,
bool searchCurrentDirectory,
bool includeNext,
std::string& resolvedFilename );
- SourceFile* RetrieveFromCacheOrParse ( Module& module,
+ SourceFile* RetrieveFromCacheOrParse ( const Module& module,
const std::string&
filename,
SourceFile*
parentSourceFile );
SourceFile* RetrieveFromCache ( const std::string& filename );
void CheckAutomaticDependencies ( bool verbose );
- void CheckAutomaticDependencies ( Module& module,
- bool verbose );
- void CheckAutomaticDependencies ( Module& module,
- bool verbose,
- bool parseFiles );
+ void CheckAutomaticDependenciesForModule ( Module& module,
+ bool verbose );
+private:
+ void GetModulesToCheck ( Module& module, std::vector<const
Module*>& modules );
+ void CheckAutomaticDependencies ( const Module& module,
+ bool verbose );
void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile
);
-private:
void GetIncludeDirectories ( std::vector<Include*>& includes,
- Module& module,
+ const Module& module,
Include& currentDirectory,
bool searchCurrentDirectory );
- void GetModuleFiles ( Module& module,
+ void GetModuleFiles ( const Module& module,
std::vector<File*>& files ) const;
void ParseFiles ();
- void ParseFiles ( Module& module );
- void ParseFile ( Module& module,
+ void ParseFiles ( const Module& module );
+ void ParseFile ( const Module& module,
const File& file );
std::map<std::string, SourceFile*> sourcefile_map;
};