*/
#include "pch.h"
#include <typeinfo>
+#include <algorithm>
#include <stdio.h>
#ifdef WIN32
using std::vector;
static string BuildSystem;
-static string RootXmlFile = "ReactOS.xml";
+static string RootXmlFile;
static Configuration configuration;
bool
char switchChar2,
char* switchStart )
{
+ string temp;
+
switch ( switchChar2 )
{
case 's':
configuration.VSProjectVersion.append("0");
break;
+ case 'c':
+ configuration.VSConfigurationType = string (&switchStart[3]);
+ configuration.InstallFiles = true;
+ break;
+ case 'o':
+ if ( strlen ( switchStart ) <= 3 )
+ {
+ printf ( "Invalid switch\n" );
+ return false;
+ }
+ temp = string (&switchStart[3]);
+ if ( temp.find ("configuration") != string::npos )
+ configuration.UseConfigurationInPath = true;
+
+ if ( temp.find ("version") != string::npos )
+ configuration.UseVSVersionInPath = true;
+ break;
default:
printf ( "Unknown switch -d%c\n",
switchChar2 );
switch ( switchChar )
{
case 'v':
- if (switchChar2 == 's')
+ if (switchChar2 == 's' || switchChar2 == 'c' || switchChar2 == 'o')
{
return ParseVCProjectSwitch (
switchChar2,
if ( !ParseArguments ( argc, argv ) )
{
printf ( "Generates project files for buildsystems\n\n" );
- printf ( " rbuild [switches] buildsystem\n\n" );
+ printf ( " rbuild [switches] -r{rootfile.rbuild} buildsystem\n\n" );
printf ( "Switches:\n" );
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 ( " -ud Disable multiple source files per compilation unit.\n" );
printf ( " -ps Generate proxy makefiles in source tree instead of the output.\n" );
printf ( " tree.\n" );
printf ( " -vs{version} Version of MS VS project files. Default is %s.\n", MS_VS_DEF_VERSION );
+ printf ( " -vo{version|configuration} Adds subdirectory path to the default Intermediate-Outputdirectory.\n" );
printf ( "\n" );
printf ( " buildsystem Target build system. Can be one of:\n" );
- printf ( " mingw MinGW\n" );
- printf ( " devcpp DevC++\n" );
- printf ( " msvc MS Visual Studio\n" );
+
+ std::map<std::string,Backend::Factory*>::iterator iter;
+ for (iter = Backend::Factory::map_begin(); iter != Backend::Factory::map_end(); iter++)
+ {
+ Backend::Factory *factory = iter->second;
+ printf ( " %-10s %s\n", factory->Name(), factory->Description());
+ }
return 1;
}
try
{
+ if ( RootXmlFile.length () == 0 )
+ throw MissingArgumentException ( "-r" );
+
string projectFilename ( RootXmlFile );
+
printf ( "Reading build files..." );
Project project ( configuration, projectFilename );
printf ( "done\n" );
- project.WriteConfigurationFile ();
- project.ExecuteInvocations ();
- Backend* backend = Backend::Factory::Create (
+
+ project.SetBackend ( Backend::Factory::Create (
BuildSystem,
project,
- configuration );
- backend->Process ();
- delete backend;
+ configuration ) );
+
+ project.WriteConfigurationFile ();
+ project.ExecuteInvocations ();
+ project.GetBackend().Process();
return 0;
}