Sync to trunk (r44371)
[reactos.git] / reactos / tools / rbuild / backend / msvc / vcprojmaker.cpp
index 2d143af..1d304c6 100644 (file)
@@ -563,382 +563,382 @@ void MSVCBackend::_generate_standard_configuration( FILE* OUT,
                vcdir = DEF_SSEP + _get_vc_dir();
        }
 
-       fprintf ( OUT, "\t\t<Configuration\r\n" );
-       fprintf ( OUT, "\t\t\tName=\"%s|Win32\"\r\n", cfg.name.c_str() );
+               fprintf ( OUT, "\t\t<Configuration\r\n" );
+               fprintf ( OUT, "\t\t\tName=\"%s|Win32\"\r\n", cfg.name.c_str() );
 
-       if ( configuration.UseConfigurationInPath )
-       {
-               fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\\%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() );
-               fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\\%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() );
-       }
-       else
-       {
-               fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
-               fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
-       }
+               if ( configuration.UseConfigurationInPath )
+               {
+                       fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\\%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() );
+                       fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\\%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str (), cfg.name.c_str() );
+               }
+               else
+               {
+                       fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
+                       fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), vcdir.c_str () );
+               }
 
        fprintf ( OUT, "\t\t\tConfigurationType=\"%d\"\r\n", CfgType );
        fprintf ( OUT, "\t\t\tCharacterSet=\"2\"\r\n" );
        fprintf ( OUT, "\t\t\t>\r\n" );
 
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCCLCompilerTool\"\r\n" );
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCCLCompilerTool\"\r\n" );
 
-       fprintf ( OUT, "\t\t\t\tOptimization=\"%d\"\r\n", release ? 2 : 0 );
+               fprintf ( OUT, "\t\t\t\tOptimization=\"%d\"\r\n", release ? 2 : 0 );
 
-       fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
-       bool multiple_includes = false;
-       fprintf ( OUT, "./;" );
-       for ( i = 0; i < includes.size(); i++ )
-       {
-               const std::string& include = includes[i];
-               if ( strcmp ( include.c_str(), "." ) )
+               fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
+               bool multiple_includes = false;
+               fprintf ( OUT, "./;" );
+               for ( i = 0; i < includes.size(); i++ )
+               {
+                       const std::string& include = includes[i];
+                       if ( strcmp ( include.c_str(), "." ) )
+                       {
+                               if ( multiple_includes )
+                                       fprintf ( OUT, ";" );
+                               fprintf ( OUT, "%s", include.c_str() );
+                               include_string += " /I " + include;
+                               multiple_includes = true;
+                       }
+               }
+               if ( include_idl )
                {
                        if ( multiple_includes )
                                fprintf ( OUT, ";" );
-                       fprintf ( OUT, "%s", include.c_str() );
-                       include_string += " /I " + include;
-                       multiple_includes = true;
-               }
-       }
-       if ( include_idl )
-       {
-               if ( multiple_includes )
-                       fprintf ( OUT, ";" );
 
-               if ( configuration.UseConfigurationInPath )
-               {
-                       fprintf ( OUT, "%s\\include\\reactos\\idl%s\\%s\r\n", intdir.c_str (), vcdir.c_str (), cfg.name.c_str() );
-               }
-               else
-               {
-                       fprintf ( OUT, "%s\\include\\reactos\\idl\r\n", intdir.c_str () );
+                       if ( configuration.UseConfigurationInPath )
+                       {
+                               fprintf ( OUT, "%s\\include\\reactos\\idl%s\\%s\r\n", intdir.c_str (), vcdir.c_str (), cfg.name.c_str() );
+                       }
+                       else
+                       {
+                               fprintf ( OUT, "%s\\include\\reactos\\idl\r\n", intdir.c_str () );
+                       }
                }
-       }
-       if ( cfg.headers == ReactOSHeaders )
-       {
-               for ( i = 0; i < includes_ros.size(); i++ )
+               if ( cfg.headers == ReactOSHeaders )
                {
-                       const std::string& include = includes_ros[i];
-                       if ( multiple_includes )
-                               fprintf ( OUT, ";" );
-                       fprintf ( OUT, "%s", include.c_str() );
-                       //include_string += " /I " + include;
-                       multiple_includes = true;
+                       for ( i = 0; i < includes_ros.size(); i++ )
+                       {
+                               const std::string& include = includes_ros[i];
+                               if ( multiple_includes )
+                                       fprintf ( OUT, ";" );
+                               fprintf ( OUT, "%s", include.c_str() );
+                               //include_string += " /I " + include;
+                               multiple_includes = true;
+                       }
                }
-       }
-       else
-       {
-               // Add WDK or PSDK paths, if user provides them
-               if (getenv ( "BASEDIR" ) != NULL &&
-                       (module.type == Kernel ||
-                        module.type == KernelModeDLL ||
-                        module.type == KernelModeDriver ||
-                        module.type == KeyboardLayout))
+               else
                {
-                       string WdkBase, SdkPath, CrtPath, DdkPath;
-                       WdkBase = getenv ( "BASEDIR" );
-                       SdkPath = WdkBase + "\\inc\\api";
-                       CrtPath = WdkBase + "\\inc\\crt";
-                       DdkPath = WdkBase + "\\inc\\ddk";
-
-                       if ( multiple_includes )
-                               fprintf ( OUT, ";" );
-
-                       fprintf ( OUT, "%s;", SdkPath.c_str() );
-                       fprintf ( OUT, "%s;", CrtPath.c_str() );
-                       fprintf ( OUT, "%s", DdkPath.c_str() );
-                       multiple_includes = true;
+                       // Add WDK or PSDK paths, if user provides them
+                       if (getenv ( "BASEDIR" ) != NULL &&
+                               (module.type == Kernel ||
+                                module.type == KernelModeDLL ||
+                                module.type == KernelModeDriver ||
+                                module.type == KeyboardLayout))
+                       {
+                               string WdkBase, SdkPath, CrtPath, DdkPath;
+                               WdkBase = getenv ( "BASEDIR" );
+                               SdkPath = WdkBase + "\\inc\\api";
+                               CrtPath = WdkBase + "\\inc\\crt";
+                               DdkPath = WdkBase + "\\inc\\ddk";
+
+                               if ( multiple_includes )
+                                       fprintf ( OUT, ";" );
+
+                               fprintf ( OUT, "%s;", SdkPath.c_str() );
+                               fprintf ( OUT, "%s;", CrtPath.c_str() );
+                               fprintf ( OUT, "%s", DdkPath.c_str() );
+                               multiple_includes = true;
+                       }
                }
-       }
-       fprintf ( OUT, "\"\r\n" );
+               fprintf ( OUT, "\"\r\n" );
 
-       StringSet defines = common_defines;
+               StringSet defines = common_defines;
 
-       // Always add _CRT_SECURE_NO_WARNINGS to disable warnings about not
-       // using the safe functions introduced in MSVC8.
-       defines.insert ( "_CRT_SECURE_NO_WARNINGS" );
+               // Always add _CRT_SECURE_NO_WARNINGS to disable warnings about not
+               // using the safe functions introduced in MSVC8.
+               defines.insert ( "_CRT_SECURE_NO_WARNINGS" );
 
-       if ( debug )
-       {
-               defines.insert ( "_DEBUG" );
-       }
+               if ( debug )
+               {
+                       defines.insert ( "_DEBUG" );
+               }
 
-       if ( cfg.headers == MSVCHeaders )
-       {
-               // this is a define in MinGW w32api, but not Microsoft's headers
-               defines.insert ( "STDCALL=__stdcall" );
-       }
+               if ( cfg.headers == MSVCHeaders )
+               {
+                       // this is a define in MinGW w32api, but not Microsoft's headers
+                       defines.insert ( "STDCALL=__stdcall" );
+               }
 
        if ( binaryType == Lib || binaryType == Exe )
-       {
-               defines.insert ( "_LIB" );
-       }
-       else
-       {
-               defines.insert ( "_WINDOWS" );
-               defines.insert ( "_USRDLL" );
-       }
-
-       fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions=\"" );
-       for ( StringSet::iterator it1=defines.begin(); it1!=defines.end(); it1++ )
-       {
-               if ( i > 0 )
-                       fprintf ( OUT, ";" );
+               {
+                       defines.insert ( "_LIB" );
+               }
+               else
+               {
+                       defines.insert ( "_WINDOWS" );
+                       defines.insert ( "_USRDLL" );
+               }
 
-               string unescaped = *it1;
-               fprintf ( OUT, "%s", _replace_str(unescaped, "\"","").c_str() );
-       }
-       fprintf ( OUT, "\"\r\n" );
-       fprintf ( OUT, "\t\t\t\tForcedIncludeFiles=\"%s\"\r\n", "warning.h");
-       fprintf ( OUT, "\t\t\t\tMinimalRebuild=\"%s\"\r\n", speed ? "TRUE" : "FALSE" );
-       fprintf ( OUT, "\t\t\t\tBasicRuntimeChecks=\"0\"\r\n" );
-       fprintf ( OUT, "\t\t\t\tRuntimeLibrary=\"%d\"\r\n", debug ? 3 : 2 );    // 3=/MDd 2=/MD
-       fprintf ( OUT, "\t\t\t\tBufferSecurityCheck=\"FALSE\"\r\n" );
-       fprintf ( OUT, "\t\t\t\tEnableFunctionLevelLinking=\"FALSE\"\r\n" );
-
-       if ( module.pch != NULL )
-       {
-               fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"2\"\r\n" );
-               string pch_path = Path::RelativeFromDirectory (
-                       module.pch->file->name,
-                       module.output->relative_path );
-               string::size_type pos = pch_path.find_last_of ("/");
-               if ( pos != string::npos )
-                       pch_path.erase(0, pos+1);
-               fprintf ( OUT, "\t\t\t\tPrecompiledHeaderThrough=\"%s\"\r\n", pch_path.c_str() );
-
-               // Only include from the same module
-               pos = pch_path.find("../");
-               if (pos == string::npos && std::find(header_files.begin(), header_files.end(), pch_path) == header_files.end())
-                       header_files.push_back(pch_path);
-       }
-       else
-       {
-               fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"0\"\r\n" );
-       }
+               fprintf ( OUT, "\t\t\t\tPreprocessorDefinitions=\"" );
+               for ( StringSet::iterator it1=defines.begin(); it1!=defines.end(); it1++ )
+               {
+                       if ( i > 0 )
+                               fprintf ( OUT, ";" );
 
-       fprintf ( OUT, "\t\t\t\tWholeProgramOptimization=\"%s\"\r\n", release ? "FALSE" : "FALSE");
-       if ( release )
-       {
-               fprintf ( OUT, "\t\t\t\tFavorSizeOrSpeed=\"1\"\r\n" );
-               fprintf ( OUT, "\t\t\t\tStringPooling=\"true\"\r\n" );
-       }
+                       string unescaped = *it1;
+                       fprintf ( OUT, "%s", _replace_str(unescaped, "\"","").c_str() );
+               }
+               fprintf ( OUT, "\"\r\n" );
+               fprintf ( OUT, "\t\t\t\tForcedIncludeFiles=\"%s\"\r\n", "warning.h");
+               fprintf ( OUT, "\t\t\t\tMinimalRebuild=\"%s\"\r\n", speed ? "TRUE" : "FALSE" );
+               fprintf ( OUT, "\t\t\t\tBasicRuntimeChecks=\"0\"\r\n" );
+               fprintf ( OUT, "\t\t\t\tRuntimeLibrary=\"%d\"\r\n", debug ? 3 : 2 );    // 3=/MDd 2=/MD
+               fprintf ( OUT, "\t\t\t\tBufferSecurityCheck=\"FALSE\"\r\n" );
+               fprintf ( OUT, "\t\t\t\tEnableFunctionLevelLinking=\"FALSE\"\r\n" );
+
+               if ( module.pch != NULL )
+               {
+                       fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"2\"\r\n" );
+                       string pch_path = Path::RelativeFromDirectory (
+                               module.pch->file->name,
+                               module.output->relative_path );
+                       string::size_type pos = pch_path.find_last_of ("/");
+                       if ( pos != string::npos )
+                               pch_path.erase(0, pos+1);
+                       fprintf ( OUT, "\t\t\t\tPrecompiledHeaderThrough=\"%s\"\r\n", pch_path.c_str() );
+
+                       // Only include from the same module
+                       pos = pch_path.find("../");
+                       if (pos == string::npos && std::find(header_files.begin(), header_files.end(), pch_path) == header_files.end())
+                               header_files.push_back(pch_path);
+               }
+               else
+               {
+                       fprintf ( OUT, "\t\t\t\tUsePrecompiledHeader=\"0\"\r\n" );
+               }
 
-       fprintf ( OUT, "\t\t\t\tWarningLevel=\"%s\"\r\n", speed ? "0" : "3" );
-       fprintf ( OUT, "\t\t\t\tDetect64BitPortabilityProblems=\"%s\"\r\n", "FALSE");
-       if ( !module.cplusplus )
-               fprintf ( OUT, "\t\t\t\tCompileAs=\"1\"\r\n" );
+               fprintf ( OUT, "\t\t\t\tWholeProgramOptimization=\"%s\"\r\n", release ? "FALSE" : "FALSE");
+               if ( release )
+               {
+                       fprintf ( OUT, "\t\t\t\tFavorSizeOrSpeed=\"1\"\r\n" );
+                       fprintf ( OUT, "\t\t\t\tStringPooling=\"true\"\r\n" );
+               }
 
-       if ( module.type == Win32CUI || module.type == Win32GUI )
-       {
-               fprintf ( OUT, "\t\t\t\tCallingConvention=\"%d\"\r\n", 0 );     // 0=__cdecl
-       }
-       else
-       {
-               fprintf ( OUT, "\t\t\t\tCallingConvention=\"%d\"\r\n", 2 );     // 2=__stdcall
-       }
+               fprintf ( OUT, "\t\t\t\tWarningLevel=\"%s\"\r\n", speed ? "0" : "3" );
+               fprintf ( OUT, "\t\t\t\tDetect64BitPortabilityProblems=\"%s\"\r\n", "FALSE");
+               if ( !module.cplusplus )
+                       fprintf ( OUT, "\t\t\t\tCompileAs=\"1\"\r\n" );
 
-       fprintf ( OUT, "\t\t\t\tDebugInformationFormat=\"%s\"/>\r\n", speed ? "0" : release ? "3": "4");        // 3=/Zi 4=ZI
+               if ( module.type == Win32CUI || module.type == Win32GUI )
+               {
+                       fprintf ( OUT, "\t\t\t\tCallingConvention=\"%d\"\r\n", 0 );     // 0=__cdecl
+               }
+               else
+               {
+                       fprintf ( OUT, "\t\t\t\tCallingConvention=\"%d\"\r\n", 2 );     // 2=__stdcall
+               }
 
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCCustomBuildTool\"/>\r\n" );
+               fprintf ( OUT, "\t\t\t\tDebugInformationFormat=\"%s\"/>\r\n", speed ? "0" : release ? "3": "4");        // 3=/Zi 4=ZI
 
-       if ( binaryType == Lib )
-       {
                fprintf ( OUT, "\t\t\t<Tool\r\n" );
-               fprintf ( OUT, "\t\t\t\tName=\"VCLibrarianTool\"\r\n" );
-               fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s.lib\"/>\r\n", module.name.c_str() );
-       }
-       else
-       {
-               fprintf ( OUT, "\t\t\t<Tool\r\n" );
-               fprintf ( OUT, "\t\t\t\tName=\"VCLinkerTool\"\r\n" );
-               if (module.GetEntryPoint() == "0" && binaryType != Sys )
-                       fprintf ( OUT, "AdditionalOptions=\"/noentry\"" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCCustomBuildTool\"/>\r\n" );
 
-               if (configuration.VSProjectVersion == "9.00")
+       if ( binaryType == Lib )
                {
-                       fprintf ( OUT, "\t\t\t\tRandomizedBaseAddress=\"0\"\r\n" );
-                       fprintf ( OUT, "\t\t\t\tDataExecutionPrevention=\"0\"\r\n" );
+                       fprintf ( OUT, "\t\t\t<Tool\r\n" );
+                       fprintf ( OUT, "\t\t\t\tName=\"VCLibrarianTool\"\r\n" );
+                       fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s.lib\"/>\r\n", module.name.c_str() );
                }
+               else
+               {
+                       fprintf ( OUT, "\t\t\t<Tool\r\n" );
+                       fprintf ( OUT, "\t\t\t\tName=\"VCLinkerTool\"\r\n" );
+               if (module.GetEntryPoint() == "0" && binaryType != Sys )
+                               fprintf ( OUT, "AdditionalOptions=\"/noentry\"" );
+
+                       if (configuration.VSProjectVersion == "9.00")
+                       {
+                               fprintf ( OUT, "\t\t\t\tRandomizedBaseAddress=\"0\"\r\n" );
+                               fprintf ( OUT, "\t\t\t\tDataExecutionPrevention=\"0\"\r\n" );
+                       }
 
-               if (module.importLibrary != NULL)
-                       fprintf ( OUT, "\t\t\t\tModuleDefinitionFile=\"%s\"\r\n", importLib.c_str());
+                       if (module.importLibrary != NULL)
+                               fprintf ( OUT, "\t\t\t\tModuleDefinitionFile=\"%s\"\r\n", importLib.c_str());
 
-               fprintf ( OUT, "\t\t\t\tAdditionalDependencies=\"" );
-               bool use_msvcrt_lib = false;
-               for ( i = 0; i < libraries.size(); i++ )
-               {
-                       if ( i > 0 )
-                               fprintf ( OUT, " " );
-                       string libpath = libraries[i].c_str();
-                       libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 );
-                       if ( libpath == "msvcrt.lib" )
+                       fprintf ( OUT, "\t\t\t\tAdditionalDependencies=\"" );
+                       bool use_msvcrt_lib = false;
+                       for ( i = 0; i < libraries.size(); i++ )
                        {
-                               use_msvcrt_lib = true;
+                               if ( i > 0 )
+                                       fprintf ( OUT, " " );
+                               string libpath = libraries[i].c_str();
+                               libpath = libpath.erase (0, libpath.find_last_of ("\\") + 1 );
+                               if ( libpath == "msvcrt.lib" )
+                               {
+                                       use_msvcrt_lib = true;
+                               }
+                               fprintf ( OUT, "%s", libpath.c_str() );
                        }
-                       fprintf ( OUT, "%s", libpath.c_str() );
-               }
-               fprintf ( OUT, "\"\r\n" );
+                       fprintf ( OUT, "\"\r\n" );
 
-               fprintf ( OUT, "\t\t\t\tAdditionalLibraryDirectories=\"" );
+                       fprintf ( OUT, "\t\t\t\tAdditionalLibraryDirectories=\"" );
 
-               // Add WDK libs paths, if needed
-               if (getenv ( "BASEDIR" ) != NULL &&
-                       (module.type == Kernel ||
-                        module.type == KernelModeDLL ||
-                        module.type == KernelModeDriver ||
-                        module.type == KeyboardLayout))
-               {
-                       string WdkBase, CrtPath, DdkPath;
-                       WdkBase = getenv ( "BASEDIR" );
-                       CrtPath = WdkBase + "\\lib\\crt\\i386";
-                       DdkPath = WdkBase + "\\lib\\wnet\\i386";
+                       // Add WDK libs paths, if needed
+                       if (getenv ( "BASEDIR" ) != NULL &&
+                               (module.type == Kernel ||
+                                module.type == KernelModeDLL ||
+                                module.type == KernelModeDriver ||
+                                module.type == KeyboardLayout))
+                       {
+                               string WdkBase, CrtPath, DdkPath;
+                               WdkBase = getenv ( "BASEDIR" );
+                               CrtPath = WdkBase + "\\lib\\crt\\i386";
+                               DdkPath = WdkBase + "\\lib\\wnet\\i386";
 
-                       fprintf ( OUT, "%s;", CrtPath.c_str() );
-                       fprintf ( OUT, "%s", DdkPath.c_str() );
+                               fprintf ( OUT, "%s;", CrtPath.c_str() );
+                               fprintf ( OUT, "%s", DdkPath.c_str() );
 
-                       if (libraries.size () > 0)
-                               fprintf ( OUT, ";" );
-               }
+                               if (libraries.size () > 0)
+                                       fprintf ( OUT, ";" );
+                       }
 
-               // Add conventional libraries dirs
-               for (i = 0; i < libraries.size (); i++)
-               {
-                       if ( i > 0 )
-                               fprintf ( OUT, ";" );
+                       // Add conventional libraries dirs
+                       for (i = 0; i < libraries.size (); i++)
+                       {
+                               if ( i > 0 )
+                                       fprintf ( OUT, ";" );
 
-                       string libpath = libraries[i].c_str();
-                       libpath.replace (libpath.find("---"), 3, cfg.name);
-                       libpath = libpath.substr (0, libpath.find_last_of ("\\") );
-                       fprintf ( OUT, "%s", libpath.c_str() );
-               }
+                               string libpath = libraries[i].c_str();
+                               libpath.replace (libpath.find("---"), 3, cfg.name);
+                               libpath = libpath.substr (0, libpath.find_last_of ("\\") );
+                               fprintf ( OUT, "%s", libpath.c_str() );
+                       }
 
-               fprintf ( OUT, "\"\r\n" );
+                       fprintf ( OUT, "\"\r\n" );
 
-               fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s%s\"\r\n", module.name.c_str(), module_type.c_str() );
-               fprintf ( OUT, "\t\t\t\tLinkIncremental=\"%d\"\r\n", debug ? 2 : 1 );
-               fprintf ( OUT, "\t\t\t\tGenerateDebugInformation=\"%s\"\r\n", speed ? "FALSE" : "TRUE" );
-               fprintf ( OUT, "\t\t\t\tLinkTimeCodeGeneration=\"%d\"\r\n", release? 0 : 0);    // whole program optimization
+                       fprintf ( OUT, "\t\t\t\tOutputFile=\"$(OutDir)/%s%s\"\r\n", module.name.c_str(), module_type.c_str() );
+                       fprintf ( OUT, "\t\t\t\tLinkIncremental=\"%d\"\r\n", debug ? 2 : 1 );
+                       fprintf ( OUT, "\t\t\t\tGenerateDebugInformation=\"%s\"\r\n", speed ? "FALSE" : "TRUE" );
+                       fprintf ( OUT, "\t\t\t\tLinkTimeCodeGeneration=\"%d\"\r\n", release? 0 : 0);    // whole program optimization
 
-               if ( debug )
-                       fprintf ( OUT, "\t\t\t\tProgramDatabaseFile=\"$(OutDir)/%s.pdb\"\r\n", module.name.c_str() );
+                       if ( debug )
+                               fprintf ( OUT, "\t\t\t\tProgramDatabaseFile=\"$(OutDir)/%s.pdb\"\r\n", module.name.c_str() );
 
                if ( binaryType == Sys )
-               {
-                       if (module.GetEntryPoint() == "0")
-                               fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /noentry /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
-                       else
-                               fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
-                       fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
-                       fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
-                       fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 );
-                       fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 );
-                       fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint() == "" ? "DriverEntry" : module.GetEntryPoint().c_str ());
-                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x10000" : baseaddr.c_str ());
-               }
-               else if ( binaryType == Exe )
-               {
-                       if ( module.type == Kernel )
                        {
-                               fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /SECTION:INIT,D /ALIGN:0x80\"\r\n" );
+                       if (module.GetEntryPoint() == "0")
+                                       fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /noentry /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
+                               else
+                                       fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20 /SECTION:INIT,D /IGNORE:4001,4037,4039,4065,4070,4078,4087,4089,4096\"\r\n" );
                                fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
                                fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
                                fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 );
                                fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 );
-                               fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"KiSystemStartup\"\r\n" );
-                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
-                       }
-                       else if ( module.type == NativeCUI )
-                       {
-                               fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20\"\r\n" );
-                               fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 1 );
-                               fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
-                               fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
-                               fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"NtProcessStartup\"\r\n" );
-                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
+                       fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint() == "" ? "DriverEntry" : module.GetEntryPoint().c_str ());
+                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x10000" : baseaddr.c_str ());
                        }
-                       else if ( module.type == Win32CUI || module.type == Win32GUI || module.type == Win32SCR)
+               else if ( binaryType == Exe )
                        {
-                               if ( use_msvcrt_lib )
+                               if ( module.type == Kernel )
+                               {
+                                       fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /SECTION:INIT,D /ALIGN:0x80\"\r\n" );
+                                       fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
+                                       fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
+                                       fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 3 );
+                                       fprintf ( OUT, "\t\t\t\tDriver=\"%d\"\r\n", 1 );
+                                       fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"KiSystemStartup\"\r\n" );
+                                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
+                               }
+                               else if ( module.type == NativeCUI )
                                {
+                                       fprintf ( OUT, "\t\t\t\tAdditionalOptions=\" /ALIGN:0x20\"\r\n" );
+                                       fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 1 );
+                                       fprintf ( OUT, "\t\t\t\tGenerateManifest=\"FALSE\"\r\n" );
                                        fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
+                                       fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"NtProcessStartup\"\r\n" );
+                                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr.c_str ());
                                }
+                               else if ( module.type == Win32CUI || module.type == Win32GUI || module.type == Win32SCR)
+                               {
+                                       if ( use_msvcrt_lib )
+                                       {
+                                               fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
+                                       }
                                fprintf ( OUT, "\t\t\t\tSubSystem=\"%d\"\r\n", 2 );
+                               }
                        }
-               }
                else if ( binaryType == Dll )
-               {
-                       if (module.GetEntryPoint() == "0")
-                               fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" );
-                       else
                        {
-                               // get rid of DllMain@12 because MSVC needs to link to _DllMainCRTStartup@12
-                               // when using CRT
-                               if (module.GetEntryPoint() == "DllMain@12")
+                       if (module.GetEntryPoint() == "0")
                                        fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" );
                                else
+                               {
+                                       // get rid of DllMain@12 because MSVC needs to link to _DllMainCRTStartup@12
+                                       // when using CRT
+                               if (module.GetEntryPoint() == "DllMain@12")
+                                               fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"\"\r\n" );
+                                       else
                                        fprintf ( OUT, "\t\t\t\tEntryPointSymbol=\"%s\"\r\n", module.GetEntryPoint().c_str ());
+                               }
+                               fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x40000" : baseaddr.c_str ());
+                               if ( use_msvcrt_lib )
+                               {
+                                       fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
+                               }
                        }
-                       fprintf ( OUT, "\t\t\t\tBaseAddress=\"%s\"\r\n", baseaddr == "" ? "0x40000" : baseaddr.c_str ());
-                       if ( use_msvcrt_lib )
-                       {
-                               fprintf ( OUT, "\t\t\t\tIgnoreAllDefaultLibraries=\"TRUE\"\r\n" );
-                       }
+                       fprintf ( OUT, "\t\t\t\tTargetMachine=\"%d\"/>\r\n", 1 );
                }
-               fprintf ( OUT, "\t\t\t\tTargetMachine=\"%d\"/>\r\n", 1 );
-       }
 
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCResourceCompilerTool\"\r\n" );
-       fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
-       multiple_includes = false;
-       fprintf ( OUT, "./;" );
-       for ( i = 0; i < includes.size(); i++ )
-       {
-               const std::string& include = includes[i];
-               if ( strcmp ( include.c_str(), "." ) )
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCResourceCompilerTool\"\r\n" );
+               fprintf ( OUT, "\t\t\t\tAdditionalIncludeDirectories=\"" );
+               multiple_includes = false;
+               fprintf ( OUT, "./;" );
+               for ( i = 0; i < includes.size(); i++ )
                {
-                       if ( multiple_includes )
-                               fprintf ( OUT, ";" );
-                       fprintf ( OUT, "%s", include.c_str() );
-                       multiple_includes = true;
+                       const std::string& include = includes[i];
+                       if ( strcmp ( include.c_str(), "." ) )
+                       {
+                               if ( multiple_includes )
+                                       fprintf ( OUT, ";" );
+                               fprintf ( OUT, "%s", include.c_str() );
+                               multiple_includes = true;
+                       }
                }
-       }
-       if ( cfg.headers == ReactOSHeaders )
-       {
-               for ( i = 0; i < includes_ros.size(); i++ )
+               if ( cfg.headers == ReactOSHeaders )
                {
-                       const std::string& include = includes_ros[i];
-                       if ( multiple_includes )
-                               fprintf ( OUT, ";" );
-                       fprintf ( OUT, "%s", include.c_str() );
-                       multiple_includes = true;
+                       for ( i = 0; i < includes_ros.size(); i++ )
+                       {
+                               const std::string& include = includes_ros[i];
+                               if ( multiple_includes )
+                                       fprintf ( OUT, ";" );
+                               fprintf ( OUT, "%s", include.c_str() );
+                               multiple_includes = true;
+                       }
                }
-       }
-       fprintf ( OUT, "\"/>\r\n " );
+               fprintf ( OUT, "\"/>\r\n " );
 
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCMIDLTool\"/>\r\n" );
-       if (configuration.VSProjectVersion == "8.00")
-       {
                fprintf ( OUT, "\t\t\t<Tool\r\n" );
-               fprintf ( OUT, "\t\t\t\tName=\"VCManifestTool\"\r\n" );
-               fprintf ( OUT, "\t\t\t\tEmbedManifest=\"false\"/>\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCMIDLTool\"/>\r\n" );
+               if (configuration.VSProjectVersion == "8.00")
+               {
+                       fprintf ( OUT, "\t\t\t<Tool\r\n" );
+                       fprintf ( OUT, "\t\t\t\tName=\"VCManifestTool\"\r\n" );
+                       fprintf ( OUT, "\t\t\t\tEmbedManifest=\"false\"/>\r\n" );
+               }
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCPostBuildEventTool\"/>\r\n" );
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCPreBuildEventTool\"/>\r\n" );
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCPreLinkEventTool\"/>\r\n" );
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\r\n" );
+               fprintf ( OUT, "\t\t\t<Tool\r\n" );
+               fprintf ( OUT, "\t\t\t\tName=\"VCWebDeploymentTool\"/>\r\n" );
+               fprintf ( OUT, "\t\t</Configuration>\r\n" );
        }
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCPostBuildEventTool\"/>\r\n" );
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCPreBuildEventTool\"/>\r\n" );
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCPreLinkEventTool\"/>\r\n" );
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCWebServiceProxyGeneratorTool\"/>\r\n" );
-       fprintf ( OUT, "\t\t\t<Tool\r\n" );
-       fprintf ( OUT, "\t\t\t\tName=\"VCWebDeploymentTool\"/>\r\n" );
-       fprintf ( OUT, "\t\t</Configuration>\r\n" );
-}
 
 
 void
@@ -955,7 +955,7 @@ MSVCBackend::_generate_makefile_configuration( FILE* OUT, const Module& module,
 
        if ( intenv == "obj-i386" )
                intdir = path_basedir + "obj-i386"; /* append relative dir from project dir */
-       else
+                       else
                intdir = intenv;
 
        if ( outenv == "output-i386" )
@@ -964,23 +964,23 @@ MSVCBackend::_generate_makefile_configuration( FILE* OUT, const Module& module,
                outdir = outenv;
 
        if ( configuration.UseVSVersionInPath )
-       {
+                       {
                vcdir = DEF_SSEP + _get_vc_dir();
-       }
+                       }
 
        fprintf ( OUT, "\t\t<Configuration\r\n" );
        fprintf ( OUT, "\t\t\tName=\"%s|Win32\"\r\n", cfg.name.c_str() );
 
        if ( configuration.UseConfigurationInPath )
-       {
+               {
                fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s\\%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str (), cfg.name.c_str() );
                fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s\\%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str (), cfg.name.c_str() );
-       }
-       else
-       {
+                       }
+                                               else
+                                               {
                fprintf ( OUT, "\t\t\tOutputDirectory=\"%s\\%s\"\r\n", outdir.c_str (), module.output->relative_path.c_str () );
                fprintf ( OUT, "\t\t\tIntermediateDirectory=\"%s\\%s\"\r\n", intdir.c_str (), module.output->relative_path.c_str () );
-       }
+                                               }
 
        fprintf ( OUT, "\t\t\tConfigurationType=\"0\"\r\n");
        fprintf ( OUT, "\t\t\t>\r\n" );
@@ -999,9 +999,9 @@ MSVCBackend::_generate_makefile_configuration( FILE* OUT, const Module& module,
        fprintf ( OUT, "\t\t\t\tForcedUsingAssemblies=\"\"\r\n");
        fprintf ( OUT, "\t\t\t\tCompileAsManaged=\"\"\r\n");
 
-       fprintf ( OUT, "\t\t\t/>\r\n" );
-       fprintf ( OUT, "\t\t</Configuration>\r\n" );
-}
+                       fprintf ( OUT, "\t\t\t/>\r\n" );
+                       fprintf ( OUT, "\t\t</Configuration>\r\n" );
+               }
 
 
 std::string