9 static class MingwFactory
: public Backend::Factory
12 MingwFactory() : Factory ( "mingw" ) {}
13 Backend
* operator() ( Project
& project
)
15 return new MingwBackend ( project
);
20 MingwBackend::MingwBackend ( Project
& project
)
26 MingwBackend::Process ()
30 GenerateGlobalVariables ();
32 for ( size_t i
= 0; i
< ProjectNode
.modules
.size (); i
++ )
34 Module
& module
= *ProjectNode
.modules
[i
];
35 ProcessModule ( module
);
41 MingwBackend::CreateMakefile ()
43 fMakefile
= fopen ( ProjectNode
.makefile
.c_str (), "w" );
45 throw AccessDeniedException ( ProjectNode
.makefile
);
46 MingwModuleHandler::SetMakefile ( fMakefile
);
50 MingwBackend::CloseMakefile ()
57 MingwBackend::GenerateHeader ()
59 fprintf ( fMakefile
, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT 'ReactOS.xml' INSTEAD\n\n" );
63 MingwBackend::GenerateGlobalVariables ()
65 fprintf ( fMakefile
, "host_gcc = gcc\n" );
66 fprintf ( fMakefile
, "host_ar = ar\n" );
67 fprintf ( fMakefile
, "host_ld = ld\n" );
68 fprintf ( fMakefile
, "rm = del /f /q\n" );
69 fprintf ( fMakefile
, "gcc = gcc\n" );
70 fprintf ( fMakefile
, "ld = ld\n" );
71 fprintf ( fMakefile
, "ar = ar\n" );
72 fprintf ( fMakefile
, "dlltool = dlltool\n" );
73 fprintf ( fMakefile
, "\n" );
77 MingwBackend::GenerateAllTarget ()
79 fprintf ( fMakefile
, "all:" );
80 for ( size_t i
= 0; i
< ProjectNode
.modules
.size (); i
++ )
82 Module
& module
= *ProjectNode
.modules
[i
];
85 FixupTargetFilename( module
.GetPath () ).c_str () );
87 fprintf ( fMakefile
, "\n\t\n\n" );
91 MingwBackend::ProcessModule ( Module
& module
)
93 MingwModuleHandler
* h
= MingwModuleHandler::LookupHandler (
96 h
->Process ( module
);
100 FixupTargetFilename ( const string
& targetFilename
)
102 return string("$(ROS_INTERMEDIATE)") + targetFilename
;