create a couple more variables to reduce makefile size
[reactos.git] / reactos / tools / rbuild / backend / mingw / modulehandler.h
index 9e1dccc..2d75222 100644 (file)
@@ -6,38 +6,83 @@
 class MingwModuleHandler\r
 {\r
 public:\r
-       MingwModuleHandler ( FILE* fMakefile );\r
-       virtual bool CanHandleModule ( const Module& module ) const = 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 () const;\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 GenerateObjectFileTargets ( const Module& module ) const;\r
-       void GenerateArchiveTarget ( const Module& module ) const;\r
-       FILE* fMakefile;\r
+       void GenerateObjectFileTargetsHost ( const Module& module ) const;\r
+       void GenerateObjectFileTargetsTarget ( const Module& module ) const;\r
+       void GenerateArchiveTargetHost ( const Module& module ) const;\r
+       void GenerateArchiveTargetTarget ( 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 GenerateObjectList ( const Module& module ) 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 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 ) const;\r
+       std::string GenerateGccAssemblerCommand ( const Module& module,\r
+                                                 const std::string& sourceFilename,\r
+                                                 const std::string& cc ) const;\r
+       std::string GenerateNasmCommand ( const Module& module,\r
+                                         const std::string& sourceFilename ) const;\r
+       std::string GenerateCommand ( const Module& module,\r
+                                     const std::string& sourceFilename,\r
+                                     const std::string& cc ) const;\r
+       void GenerateObjectFileTargets ( const Module& module,\r
+                                        const std::string& cc ) const;\r
+       void GenerateArchiveTarget ( const Module& module,\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
+       void GenerateBuildToolModuleTarget ( const Module& module );\r
 };\r
 \r
 \r
 class MingwKernelModuleHandler : public MingwModuleHandler\r
 {\r
 public:\r
-       MingwKernelModuleHandler ( FILE* fMakefile );\r
-       virtual bool CanHandleModule ( const Module& module ) const;\r
+       MingwKernelModuleHandler ();\r
        virtual void Process ( const Module& module );\r
 private:\r
        void GenerateKernelModuleTarget ( const Module& module );\r
@@ -47,11 +92,20 @@ private:
 class MingwStaticLibraryModuleHandler : public MingwModuleHandler\r
 {\r
 public:\r
-       MingwStaticLibraryModuleHandler ( FILE* fMakefile );\r
-       virtual bool CanHandleModule ( const Module& module ) const;\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
 #endif /* MINGW_MODULEHANDLER_H */\r