Refactor GenerateGlobalCFlagsAndProperties
authorCasper Hornstrup <chorns@users.sourceforge.net>
Sat, 15 Jan 2005 23:00:02 +0000 (23:00 +0000)
committerCasper Hornstrup <chorns@users.sourceforge.net>
Sat, 15 Jan 2005 23:00:02 +0000 (23:00 +0000)
svn path=/branches/xmlbuildsystem/; revision=13069

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

index 04ea376..48caff5 100644 (file)
@@ -59,9 +59,44 @@ MingwBackend::GenerateHeader ()
        fprintf ( fMakefile, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT 'ReactOS.xml' INSTEAD\n\n" );\r
 }\r
 \r
+void\r
+MingwBackend::GenerateProjectCFlagsMacro ( const char* assignmentOperation,\r
+                                           const vector<Include*>& includes,\r
+                                           const vector<Define*>& defines ) const\r
+{\r
+       size_t i;\r
+\r
+       fprintf (\r
+               fMakefile,\r
+               "PROJECT_CFLAGS %s",\r
+               assignmentOperation );\r
+       for ( i = 0; i < includes.size(); i++ )\r
+       {\r
+               fprintf (\r
+                       fMakefile,\r
+                       " -I%s",\r
+                       includes[i]->directory.c_str() );\r
+       }\r
+       \r
+       for ( i = 0; i < defines.size(); i++ )\r
+       {\r
+               Define& d = *defines[i];\r
+               fprintf (\r
+                       fMakefile,\r
+                       " -D%s",\r
+                       d.name.c_str() );\r
+               if ( d.value.size() )\r
+                       fprintf (\r
+                               fMakefile,\r
+                               "=%s",\r
+                               d.value.c_str() );\r
+       }\r
+       fprintf ( fMakefile, "\n" );\r
+}\r
+\r
 void\r
 MingwBackend::GenerateGlobalCFlagsAndProperties (\r
-       const char* op,\r
+       const char* assignmentOperation,\r
        const vector<Property*>& properties,\r
        const vector<Include*>& includes,\r
        const vector<Define*>& defines,\r
@@ -79,31 +114,9 @@ MingwBackend::GenerateGlobalCFlagsAndProperties (
 \r
        if ( includes.size() || defines.size() )\r
        {\r
-               fprintf (\r
-                       fMakefile,\r
-                       "PROJECT_CFLAGS %s",\r
-                       op );\r
-               for ( i = 0; i < includes.size(); i++ )\r
-               {\r
-                       fprintf (\r
-                               fMakefile,\r
-                               " -I%s",\r
-                               includes[i]->directory.c_str() );\r
-               }\r
-               for ( i = 0; i < defines.size(); i++ )\r
-               {\r
-                       Define& d = *defines[i];\r
-                       fprintf (\r
-                               fMakefile,\r
-                               " -D%s",\r
-                               d.name.c_str() );\r
-                       if ( d.value.size() )\r
-                               fprintf (\r
-                                       fMakefile,\r
-                                       "=%s",\r
-                                       d.value.c_str() );\r
-               }\r
-               fprintf ( fMakefile, "\n" );\r
+               GenerateProjectCFlagsMacro ( assignmentOperation,\r
+                                     includes,\r
+                                     defines );\r
        }\r
 \r
        for ( i = 0; i < ifs.size(); i++ )\r
index 0f047d8..04bab3e 100644 (file)
@@ -14,13 +14,14 @@ private:
        void CreateMakefile ();\r
        void CloseMakefile ();\r
        void GenerateHeader ();\r
-       void\r
-       MingwBackend::GenerateGlobalCFlagsAndProperties (\r
-               const char* op,\r
-               const std::vector<Property*>& properties,\r
-               const std::vector<Include*>& includes,\r
-               const std::vector<Define*>& defines,\r
-               const std::vector<If*>& ifs );\r
+       void GenerateProjectCFlagsMacro ( const char* assignmentOperation,\r
+                                         const std::vector<Include*>& includes,\r
+                                         const std::vector<Define*>& defines ) const;\r
+       void GenerateGlobalCFlagsAndProperties ( const char* op,\r
+                                                const std::vector<Property*>& properties,\r
+                                                const std::vector<Include*>& includes,\r
+                                                const std::vector<Define*>& defines,\r
+                                                const std::vector<If*>& ifs );\r
        std::string GenerateProjectLFLAGS ();\r
        void GenerateGlobalVariables ();\r
        void GenerateAllTarget ();\r