class MingwModuleHandler\r
{\r
public:\r
- MingwModuleHandler ( FILE* fMakefile );\r
- virtual bool CanHandleModule ( Module& module ) = 0;\r
- virtual void Process ( Module& module ) = 0;\r
+ static std::map<ModuleType,MingwModuleHandler*>* handler_map;\r
+ static int ref;\r
+\r
+ MingwModuleHandler ( ModuleType moduletype );\r
+ virtual ~MingwModuleHandler();\r
+\r
+ static void SetMakefile ( FILE* f );\r
+ static MingwModuleHandler* LookupHandler ( const std::string& location,\r
+ ModuleType moduletype_ );\r
+ virtual void Process ( const Module& module ) = 0;\r
+\r
protected:\r
- std::string MingwModuleHandler::GetWorkingDirectory ();\r
- std::string ReplaceExtension ( std::string filename,\r
- std::string newExtension );\r
- std::string GetModuleArchiveFilename ( Module& module );\r
- std::string GetImportLibraryDependencies ( Module& module );\r
- std::string GetSourceFilenames ( Module& module );\r
- std::string GetObjectFilename ( std::string sourceFilename );\r
- std::string GetObjectFilenames ( Module& module );\r
- void GenerateObjectFileTargets ( Module& module );\r
- void GenerateArchiveTarget ( Module& module );\r
- FILE* fMakefile;\r
+ std::string GetWorkingDirectory () const;\r
+ std::string GetExtension ( const std::string& filename ) const;\r
+ std::string ReplaceExtension ( const std::string& filename,\r
+ const std::string& newExtension ) const;\r
+ std::string GetModuleArchiveFilename ( const Module& module ) const;\r
+ std::string GetImportLibraryDependencies ( const Module& module ) const;\r
+ std::string GetModuleDependencies ( const Module& module ) const;\r
+ std::string GetAllDependencies ( const Module& module ) const;\r
+ std::string GetSourceFilenames ( const Module& module ) const;\r
+\r
+ std::string GetObjectFilename ( const std::string& sourceFilename ) const;\r
+ std::string GetObjectFilenames ( const Module& module ) const;\r
+ void GenerateMacrosAndTargetsHost ( const Module& module ) const;\r
+ void GenerateMacrosAndTargetsTarget ( const Module& module ) const;\r
+ std::string GetInvocationDependencies ( const Module& module ) const;\r
+ std::string GetInvocationParameters ( const Invoke& invoke ) const;\r
+ void GenerateInvocations ( const Module& module ) const;\r
+ void GeneratePreconditionDependencies ( const Module& module ) const;\r
+ std::string GenerateMacros ( const Module& module,\r
+ const std::string& cflags_macro,\r
+ const std::string& objs_macro ) const;\r
+ static FILE* fMakefile;\r
+private:\r
+ std::string ConcatenatePaths ( const std::string& path1,\r
+ const std::string& path2 ) const;\r
+ std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const;\r
+ std::string GenerateGccDefineParameters ( const Module& module ) const;\r
+ std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;\r
+ void GenerateMacros ( const char* op,\r
+ const std::vector<File*>& files,\r
+ const std::vector<Include*>& includes,\r
+ const std::vector<Define*>& defines,\r
+ const std::vector<If*>& ifs,\r
+ const std::string& cflags_macro,\r
+ const std::string& nasmflags_macro,\r
+ const std::string& objs_macro) const;\r
+ void GenerateMacros ( const Module& module,\r
+ const std::string& cflags_macro,\r
+ const std::string& nasmflags_macro,\r
+ const std::string& objs_macro) const;\r
+ void GenerateGccModuleIncludeVariable ( const Module& module ) const;\r
+ std::string GenerateGccIncludeParameters ( const Module& module ) const;\r
+ std::string GenerateGccParameters ( const Module& module ) const;\r
+ std::string GenerateNasmParameters ( const Module& module ) const;\r
+ std::string GenerateGccCommand ( const Module& module,\r
+ const std::string& sourceFilename,\r
+ const std::string& cc,\r
+ const std::string& cflagsMacro ) const;\r
+ std::string GenerateGccAssemblerCommand ( const Module& module,\r
+ const std::string& sourceFilename,\r
+ const std::string& cc,\r
+ const std::string& cflagsMacro ) const;\r
+ std::string GenerateNasmCommand ( const Module& module,\r
+ const std::string& sourceFilename,\r
+ const std::string& nasmflagsMacro ) const;\r
+ std::string GenerateCommand ( const Module& module,\r
+ const std::string& sourceFilename,\r
+ const std::string& cc,\r
+ const std::string& cflagsMacro,\r
+ const std::string& nasmflagsMacro ) const;\r
+ void GenerateObjectFileTargets ( const Module& module,\r
+ const std::vector<File*>& files,\r
+ const std::vector<If*>& ifs,\r
+ const std::string& cc,\r
+ const std::string& cflagsMacro,\r
+ const std::string& nasmflagsMacro ) const;\r
+ void GenerateObjectFileTargets ( const Module& module,\r
+ const std::string& cc,\r
+ const std::string& cflagsMacro,\r
+ const std::string& nasmflagsMacro ) const;\r
+ void GenerateArchiveTarget ( const Module& module,\r
+ const std::string& ar,\r
+ const std::string& objs_macro ) const;\r
+ void GenerateMacrosAndTargets ( const Module& module,\r
+ const std::string& cc,\r
+ const std::string& ar ) const;\r
+ std::string GetPreconditionDependenciesName ( const Module& module ) const;\r
+};\r
+\r
+\r
+class MingwBuildToolModuleHandler : public MingwModuleHandler\r
+{\r
+public:\r
+ MingwBuildToolModuleHandler ();\r
+ virtual void Process ( const Module& module );\r
private:\r
- std::string ConcatenatePaths ( std::string path1,\r
- std::string path2 );\r
- std::string GenerateGccDefineParametersFromVector ( std::vector<Define*> defines );\r
- std::string GenerateGccDefineParameters ( Module& module );\r
- std::string GenerateGccIncludeParametersFromVector ( std::string basePath,\r
- std::vector<Include*> includes );\r
- std::string GenerateGccIncludeParameters ( Module& module );\r
- std::string GenerateGccParameters ( Module& module );\r
+ void GenerateBuildToolModuleTarget ( const Module& module );\r
};\r
\r
\r
class MingwKernelModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwKernelModuleHandler ( FILE* fMakefile );\r
- virtual bool CanHandleModule ( Module& module );\r
- virtual void Process ( Module& module );\r
+ MingwKernelModuleHandler ();\r
+ virtual void Process ( const Module& module );\r
private:\r
- void GenerateKernelModuleTarget ( Module& module );\r
+ void GenerateKernelModuleTarget ( const Module& module );\r
};\r
\r
\r
class MingwStaticLibraryModuleHandler : public MingwModuleHandler\r
{\r
public:\r
- MingwStaticLibraryModuleHandler ( FILE* fMakefile );\r
- virtual bool CanHandleModule ( Module& module );\r
- virtual void Process ( Module& module );\r
+ MingwStaticLibraryModuleHandler ();\r
+ virtual void Process ( const Module& module );\r
+private:\r
+ void GenerateStaticLibraryModuleTarget ( const Module& module );\r
+};\r
+\r
+\r
+class MingwKernelModeDLLModuleHandler : public MingwModuleHandler\r
+{\r
+public:\r
+ MingwKernelModeDLLModuleHandler ();\r
+ virtual void Process ( const Module& module );\r
+private:\r
+ void GenerateKernelModeDLLModuleTarget ( const Module& module );\r
+};\r
+\r
+\r
+class MingwNativeDLLModuleHandler : public MingwModuleHandler\r
+{\r
+public:\r
+ MingwNativeDLLModuleHandler ();\r
+ virtual void Process ( const Module& module );\r
+private:\r
+ void GenerateNativeDLLModuleTarget ( const Module& module );\r
+};\r
+\r
+\r
+class MingwWin32DLLModuleHandler : public MingwModuleHandler\r
+{\r
+public:\r
+ MingwWin32DLLModuleHandler ();\r
+ virtual void Process ( const Module& module );\r
private:\r
- void GenerateStaticLibraryModuleTarget ( Module& module );\r
+ void GenerateWin32DLLModuleTarget ( const Module& module );\r
};\r
\r
#endif /* MINGW_MODULEHANDLER_H */\r