static Configuration configuration;
bool
-ParseAutomaticDependencySwitch ( char switchChar2,
- char* switchStart )
+ParseAutomaticDependencySwitch (
+ char switchChar2,
+ char* switchStart )
{
switch ( switchChar2 )
{
return true;
}
+bool
+ParseCompilationUnitSwitch (
+ char switchChar2,
+ char* switchStart )
+{
+ switch ( switchChar2 )
+ {
+ case 'd':
+ configuration.CompilationUnitsEnabled = false;
+ break;
+ default:
+ printf ( "Unknown switch -u%c\n",
+ switchChar2 );
+ return false;
+ }
+ return true;
+}
bool
-ParseVCProjectSwitch ( char switchChar2,
- char* switchStart )
+ParseVCProjectSwitch (
+ char switchChar2,
+ char* switchStart )
{
switch ( switchChar2 )
{
if (configuration.VSProjectVersion.length() == 3) //7.1
configuration.VSProjectVersion.append("0");
+ break;
+ case 'c':
+ configuration.VSConfigurationType = string (&switchStart[3]);
+ configuration.InstallFiles = true;
break;
default:
printf ( "Unknown switch -d%c\n",
switch ( switchChar )
{
case 'v':
- if (switchChar2 == 's')
- return ParseVCProjectSwitch ( switchChar2,
- argv[index] );
+ if (switchChar2 == 's' || switchChar2 == 'c' )
+ {
+ return ParseVCProjectSwitch (
+ switchChar2,
+ argv[index] );
+ }
else
configuration.Verbose = true;
break;
configuration.CleanAsYouGo = true;
break;
case 'd':
- return ParseAutomaticDependencySwitch ( switchChar2,
- argv[index] );
+ return ParseAutomaticDependencySwitch (
+ switchChar2,
+ argv[index] );
+ case 'u':
+ return ParseCompilationUnitSwitch (
+ switchChar2,
+ argv[index] );
case 'r':
RootXmlFile = string(&argv[index][2]);
break;
case 'p':
return ParseProxyMakefileSwitch ( switchChar2 );
default:
- printf ( "Unknown switch -%c\n",
- switchChar );
+ printf (
+ "Unknown switch -%c\n",
+ switchChar );
return false;
}
return true;
printf ( " -v Be verbose.\n" );
printf ( " -c Clean as you go. Delete generated files as soon as they are not\n" );
printf ( " needed anymore.\n" );
+ printf ( " -r{file.xml} Name of the root xml file. Default is ReactOS.xml.\n" );
printf ( " -dd Disable automatic dependencies.\n" );
printf ( " -dm{module} Check only automatic dependencies for this module.\n" );
- printf ( " -r{file.xml} Name of the root xml file. Default is ReactOS.xml.\n" );
+ printf ( " -ud Disable multiple source files per compilation unit.\n" );
printf ( " -mi Let make handle creation of install directories. Rbuild will\n" );
printf ( " not generate the directories.\n" );
printf ( " -ps Generate proxy makefiles in source tree instead of the output.\n" );
try
{
string projectFilename ( RootXmlFile );
+
printf ( "Reading build files..." );
- Project project ( projectFilename );
+ Project project ( configuration, projectFilename );
printf ( "done\n" );
+
+ project.SetBackend ( Backend::Factory::Create (
+ BuildSystem,
+ project,
+ configuration ) );
+
project.WriteConfigurationFile ();
project.ExecuteInvocations ();
- Backend* backend = Backend::Factory::Create ( BuildSystem,
- project,
- configuration );
- backend->Process ();
- delete backend;
+ project.GetBackend().Process();
return 0;
}
- catch (Exception& ex)
+ catch ( Exception& ex )
+ {
+ printf ( "%s\n", (*ex).c_str () );
+ return 1;
+ }
+ catch ( XMLException& ex )
{
- printf ( "%s\n",
- ex.Message.c_str () );
+ printf ( "%s\n", (*ex).c_str () );
return 1;
}
}