* Run build tools after parsing build files
[reactos.git] / reactos / tools / rbuild / rbuild.cpp
1 // rbuild.cpp
2
3 #include "pch.h"
4 #include <typeinfo>
5
6 #include <stdio.h>
7 #ifdef WIN32
8 #include <io.h>
9 #endif
10 #include <assert.h>
11
12 #include "rbuild.h"
13 #include "backend/backend.h"
14 #include "backend/mingw/mingw.h"
15
16 using std::string;
17 using std::vector;
18
19 int
20 main ( int argc, char** argv )
21 {
22 if ( argc != 2 )
23 {
24 printf ( "syntax: rbuild {buildtarget}\n" );
25 return 1;
26 }
27 string buildtarget ( argv[1] );
28 strlwr ( &buildtarget[0] );
29 try
30 {
31 string projectFilename ( "ReactOS.xml" );
32 Project project ( projectFilename );
33 project.WriteConfigurationFile ();
34 project.ExecuteInvocations ();
35 Backend* backend = Backend::Factory::Create ( buildtarget,
36 project );
37 backend->Process ();
38 delete backend;
39
40 return 0;
41 }
42 catch (Exception& ex)
43 {
44 printf ( "%s: %s\n",
45 typeid(ex).name(), ex.Message.c_str() );
46 return 1;
47 }
48 }