create a couple more variables to reduce makefile size
authorRoyce Mitchell III <royce3@ev1.net>
Tue, 11 Jan 2005 18:20:30 +0000 (18:20 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Tue, 11 Jan 2005 18:20:30 +0000 (18:20 +0000)
preparations for <if> support

svn path=/branches/xmlbuildsystem/; revision=12925

reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.h

index 5c776a5..de6c5e8 100644 (file)
@@ -237,10 +237,11 @@ MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Includ
 void\r
 MingwModuleHandler::GenerateGccModuleIncludeVariable ( const Module& module ) const\r
 {\r
-       string name ( module.name + "_INCLUDES" );\r
+       string name ( module.name + "_CFLAGS" );\r
        fprintf ( fMakefile,\r
-                 "%s := %s\n",\r
+                 "%s := %s %s\n",\r
                  name.c_str(),\r
+                         GenerateGccDefineParameters(module).c_str(),\r
                  GenerateGccIncludeParameters(module).c_str() );\r
 }\r
 \r
@@ -260,9 +261,7 @@ MingwModuleHandler::GenerateGccIncludeParameters ( const Module& module ) const
 string\r
 MingwModuleHandler::GenerateGccParameters ( const Module& module ) const\r
 {\r
-       string parameters = GenerateGccDefineParameters ( module );\r
-       parameters += ssprintf(" $(%s_INCLUDES)", module.name.c_str());\r
-       return parameters;\r
+       return ssprintf(" $(%s_CFLAGS)", module.name.c_str());\r
 }\r
 \r
 string\r
@@ -381,18 +380,18 @@ MingwModuleHandler::GenerateArchiveTarget ( const Module& module,
 {\r
        string archiveFilename = GetModuleArchiveFilename ( module );\r
        string sourceFilenames = GetSourceFilenames ( module );\r
-       string objectFilenames = GetObjectFilenames ( module );\r
+       string objectsMacro = GenerateObjectList ( module );\r
        \r
        fprintf ( fMakefile,\r
                  "%s: %s\n",\r
                  archiveFilename.c_str (),\r
-                 objectFilenames.c_str ());\r
+                 objectsMacro.c_str ());\r
 \r
        fprintf ( fMakefile,\r
                  "\t%s -rc %s %s\n\n",\r
                  ar.c_str (),\r
                  archiveFilename.c_str (),\r
-                 objectFilenames.c_str ());\r
+                 objectsMacro.c_str ());\r
 }\r
 \r
 void\r
@@ -527,6 +526,17 @@ MingwModuleHandler::GeneratePreconditionDependencies ( const Module& module ) co
                  preconditionDependenciesName.c_str () );\r
 }\r
 \r
+string MingwModuleHandler::GenerateObjectList ( const Module& module ) const\r
+{\r
+       string macro ( ssprintf("%s_OBJS",module.name.c_str()) );\r
+       fprintf (\r
+               fMakefile,\r
+               "%s = %s\n",\r
+               macro.c_str(),\r
+               GetObjectFilenames(module).c_str() );\r
+       return ssprintf("$(%s)",macro.c_str());\r
+}\r
+\r
 \r
 static MingwBuildToolModuleHandler buildtool_handler;\r
 \r
index 91dd3e2..2d75222 100644 (file)
@@ -38,6 +38,7 @@ protected:
        std::string GetInvocationParameters ( const Invoke& invoke ) const;\r
        void GenerateInvocations ( const Module& module ) const;\r
        void GeneratePreconditionDependencies ( const Module& module ) const;\r
+       std::string GenerateObjectList ( const Module& module ) const;\r
        static FILE* fMakefile;\r
 private:\r
        std::string ConcatenatePaths ( const std::string& path1,\r