Author: hpoussin
Date: Thu Oct 11 14:18:47 2007
New Revision: 29495
URL:
http://svn.reactos.org/svn/reactos?rev=29495&view=rev
Log:
Add list of source files in generated makefile
Modified:
trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
Modified: trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/mingw.cpp Thu Oct 11 14:18:47 2007
@@ -260,6 +260,8 @@
size_t iend = v.size ();
+ for ( i = 0; i < iend; i++ )
+ v[i]->GenerateSourceMacro();
for ( i = 0; i < iend; i++ )
v[i]->GenerateObjectMacro();
fprintf ( fMakefile, "\n" );
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.cpp Thu Oct 11 14:18:47 2007
@@ -907,10 +907,76 @@
}
void
+MingwModuleHandler::GenerateSourceMacros (
+ const char* assignmentOperation,
+ const IfableData& data )
+{
+ size_t i;
+
+ const vector<CompilationUnit*>& compilationUnits = data.compilationUnits;
+ vector<const FileLocation *> headers;
+ if ( compilationUnits.size () > 0 )
+ {
+ fprintf (
+ fMakefile,
+ "%s %s",
+ sourcesMacro.c_str (),
+ assignmentOperation );
+ for ( i = 0; i < compilationUnits.size(); i++ )
+ {
+ CompilationUnit& compilationUnit = *compilationUnits[i];
+ fprintf (
+ fMakefile,
+ "%s%s",
+ ( i%10 == 9 ? " \\\n\t" : " " ),
+ backend->GetFullName ( *compilationUnit.GetFilename () ).c_str () );
+ }
+ fprintf ( fMakefile, "\n" );
+ }
+
+ const vector<If*>& ifs = data.ifs;
+ for ( i = 0; i < ifs.size(); i++ )
+ {
+ If& rIf = *ifs[i];
+ if ( rIf.data.defines.size()
+ || rIf.data.includes.size()
+ || rIf.data.libraries.size()
+ || rIf.data.compilationUnits.size()
+ || rIf.data.compilerFlags.size()
+ || rIf.data.ifs.size() )
+ {
+ fprintf (
+ fMakefile,
+ "%s (\"$(%s)\",\"%s\")\n",
+ rIf.negated ? "ifneq" : "ifeq",
+ rIf.property.c_str(),
+ rIf.value.c_str() );
+ GenerateSourceMacros (
+ "+=",
+ rIf.data );
+ fprintf (
+ fMakefile,
+ "endif\n\n" );
+ }
+ }
+
+ vector<CompilationUnit*> sourceCompilationUnits;
+ GetModuleSpecificCompilationUnits ( sourceCompilationUnits );
+ for ( i = 0; i < sourceCompilationUnits.size (); i++ )
+ {
+ fprintf (
+ fMakefile,
+ "%s += %s\n",
+ sourcesMacro.c_str(),
+ backend->GetFullName ( *sourceCompilationUnits[i]->GetFilename () ).c_str () );
+ }
+ CleanupCompilationUnitVector ( sourceCompilationUnits );
+}
+
+void
MingwModuleHandler::GenerateObjectMacros (
const char* assignmentOperation,
- const IfableData& data,
- const vector<LinkerFlag*>* linkerFlags )
+ const IfableData& data )
{
size_t i;
@@ -988,8 +1054,7 @@
rIf.value.c_str() );
GenerateObjectMacros (
"+=",
- rIf.data,
- NULL );
+ rIf.data );
fprintf (
fMakefile,
"endif\n\n" );
@@ -1887,14 +1952,26 @@
}
void
+MingwModuleHandler::GenerateSourceMacro ()
+{
+ sourcesMacro = ssprintf ( "%s_SOURCES", module.name.c_str ());
+
+ GenerateSourceMacros (
+ "=",
+ module.non_if_data );
+
+ // future references to the macro will be to get its values
+ sourcesMacro = ssprintf ("$(%s)", sourcesMacro.c_str ());
+}
+
+void
MingwModuleHandler::GenerateObjectMacro ()
{
objectsMacro = ssprintf ("%s_OBJS", module.name.c_str ());
GenerateObjectMacros (
"=",
- module.non_if_data,
- &module.linkerFlags );
+ module.non_if_data );
// future references to the macro will be to get its values
objectsMacro = ssprintf ("$(%s)", objectsMacro.c_str ());
Modified: trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/rbuild/backend/mingw…
==============================================================================
--- trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h (original)
+++ trunk/reactos/tools/rbuild/backend/mingw/modulehandler.h Thu Oct 11 14:18:47 2007
@@ -57,6 +57,7 @@
std::string GetModuleTargets ( const Module& module );
void GetObjectsVector ( const IfableData& data,
std::vector<FileLocation>& objectFiles ) const;
+ void GenerateSourceMacro();
void GenerateObjectMacro();
void GenerateTargetMacro();
void GenerateOtherMacros();
@@ -139,9 +140,10 @@
void GenerateMacros ( const char* op,
const IfableData& data,
const std::vector<LinkerFlag*>* linkerFlags );
+ void GenerateSourceMacros ( const char* assignmentOperation,
+ const IfableData& data );
void GenerateObjectMacros ( const char* assignmentOperation,
- const IfableData& data,
- const std::vector<LinkerFlag*>* linkerFlags );
+ const IfableData& data );
std::string GenerateGccIncludeParameters () const;
std::string GenerateGccParameters () const;
std::string GenerateNasmParameters () const;
@@ -221,6 +223,7 @@
std::string windresflagsMacro;
std::string widlflagsMacro;
std::string linkerflagsMacro;
+ std::string sourcesMacro;
std::string objectsMacro;
std::string libsMacro;
std::string linkDepsMacro;