Precondition dependencies.
[reactos.git] / reactos / tools / rbuild / backend / mingw / modulehandler.h
1 #ifndef MINGW_MODULEHANDLER_H
2 #define MINGW_MODULEHANDLER_H
3
4 #include "../backend.h"
5
6 class MingwModuleHandler
7 {
8 public:
9 MingwModuleHandler ( FILE* fMakefile );
10 virtual bool CanHandleModule ( const Module& module ) const = 0;
11 virtual void Process ( const Module& module ) = 0;
12 protected:
13 std::string MingwModuleHandler::GetWorkingDirectory () const;
14 std::string ReplaceExtension ( const std::string& filename,
15 const std::string& newExtension ) const;
16 std::string GetModuleArchiveFilename ( const Module& module ) const;
17 std::string GetImportLibraryDependencies ( const Module& module ) const;
18 std::string GetModuleDependencies ( const Module& module ) const;
19 std::string GetAllDependencies ( const Module& module ) const;
20 std::string GetSourceFilenames ( const Module& module ) const;
21
22 std::string GetObjectFilename ( const std::string& sourceFilename ) const;
23 std::string GetObjectFilenames ( const Module& module ) const;
24 void GenerateObjectFileTargetsHost ( const Module& module ) const;
25 void GenerateObjectFileTargetsTarget ( const Module& module ) const;
26 void GenerateArchiveTargetHost ( const Module& module ) const;
27 void GenerateArchiveTargetTarget ( const Module& module ) const;
28 std::string GetInvocationDependencies ( const Module& module ) const;
29 std::string GetInvocationParameters ( const Invoke& invoke ) const;
30 void GenerateInvocations ( const Module& module ) const;
31 void GeneratePreconditionDependencies ( const Module& module ) const;
32 FILE* fMakefile;
33 private:
34 std::string ConcatenatePaths ( const std::string& path1,
35 const std::string& path2 ) const;
36 std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const;
37 std::string GenerateGccDefineParameters ( const Module& module ) const;
38 std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;
39 std::string GenerateGccIncludeParameters ( const Module& module ) const;
40 std::string GenerateGccParameters ( const Module& module ) const;
41 void GenerateObjectFileTargets ( const Module& module,
42 const std::string& cc ) const;
43 void GenerateArchiveTarget ( const Module& module,
44 const std::string& ar ) const;
45 std::string GetPreconditionDependenciesName ( const Module& module ) const;
46 };
47
48
49 class MingwBuildToolModuleHandler : public MingwModuleHandler
50 {
51 public:
52 MingwBuildToolModuleHandler ( FILE* fMakefile );
53 virtual bool CanHandleModule ( const Module& module ) const;
54 virtual void Process ( const Module& module );
55 private:
56 void GenerateBuildToolModuleTarget ( const Module& module );
57 };
58
59
60 class MingwKernelModuleHandler : public MingwModuleHandler
61 {
62 public:
63 MingwKernelModuleHandler ( FILE* fMakefile );
64 virtual bool CanHandleModule ( const Module& module ) const;
65 virtual void Process ( const Module& module );
66 private:
67 void GenerateKernelModuleTarget ( const Module& module );
68 };
69
70
71 class MingwStaticLibraryModuleHandler : public MingwModuleHandler
72 {
73 public:
74 MingwStaticLibraryModuleHandler ( FILE* fMakefile );
75 virtual bool CanHandleModule ( const Module& module ) const;
76 virtual void Process ( const Module& module );
77 private:
78 void GenerateStaticLibraryModuleTarget ( const Module& module );
79 };
80
81 #endif /* MINGW_MODULEHANDLER_H */