13 #include "backend/backend.h"
14 #include "backend/mingw/mingw.h"
19 static string BuildSystem
;
20 static string RootXmlFile
= "ReactOS.xml";
21 static bool Verbose
= false;
22 static bool CleanAsYouGo
= false;
25 ParseSwitch ( int argc
, char** argv
, int index
)
27 char switchChar
= argv
[index
][1];
37 RootXmlFile
= string(&argv
[index
][2]);
40 printf ( "Unknown switch -%c",
48 ParseArguments ( int argc
, char** argv
)
53 for ( int i
= 1; i
< argc
; i
++ )
55 if ( argv
[i
][0] == '-' )
57 if ( !ParseSwitch ( argc
, argv
, i
) )
61 BuildSystem
= argv
[i
];
68 main ( int argc
, char** argv
)
70 if ( !ParseArguments ( argc
, argv
) )
72 printf ( "Generates project files for buildsystems\n\n" );
73 printf ( " rbuild [-v] [-rfile.xml] buildsystem\n\n" );
74 printf ( "Switches:\n" );
75 printf ( " -v Be verbose\n" );
76 printf ( " -c Clean as you go. Delete generated files as soon as they are not needed anymore\n" );
77 printf ( " -rfile.xml Name of the root xml file. Default is ReactOS.xml\n" );
79 printf ( " buildsystem Target build system. Can be one of:\n" );
80 printf ( " mingw MinGW\n" );
81 printf ( " devcpp DevC++\n" );
86 string
projectFilename ( RootXmlFile
);
87 printf ( "Reading build files..." );
88 Project
project ( projectFilename
);
90 project
.WriteConfigurationFile ();
91 project
.ExecuteInvocations ();
92 Backend
* backend
= Backend::Factory::Create ( BuildSystem
,
101 catch (Exception
& ex
)
104 ex
.Message
.c_str () );