Invocation of buildtool modules.
[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 void GenerateInvocations ( const Module& module ) const;
30 FILE* fMakefile;
31 private:
32 std::string ConcatenatePaths ( const std::string& path1,
33 const std::string& path2 ) const;
34 std::string GenerateGccDefineParametersFromVector ( const std::vector<Define*>& defines ) const;
35 std::string GenerateGccDefineParameters ( const Module& module ) const;
36 std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;
37 std::string GenerateGccIncludeParameters ( const Module& module ) const;
38 std::string GenerateGccParameters ( const Module& module ) const;
39 void GenerateObjectFileTargets ( const Module& module,
40 const std::string& cc ) const;
41 void GenerateArchiveTarget ( const Module& module,
42 const std::string& ar ) const;
43 };
44
45
46 class MingwBuildToolModuleHandler : public MingwModuleHandler
47 {
48 public:
49 MingwBuildToolModuleHandler ( FILE* fMakefile );
50 virtual bool CanHandleModule ( const Module& module ) const;
51 virtual void Process ( const Module& module );
52 private:
53 void GenerateBuildToolModuleTarget ( const Module& module );
54 };
55
56
57 class MingwKernelModuleHandler : public MingwModuleHandler
58 {
59 public:
60 MingwKernelModuleHandler ( FILE* fMakefile );
61 virtual bool CanHandleModule ( const Module& module ) const;
62 virtual void Process ( const Module& module );
63 private:
64 void GenerateKernelModuleTarget ( const Module& module );
65 };
66
67
68 class MingwStaticLibraryModuleHandler : public MingwModuleHandler
69 {
70 public:
71 MingwStaticLibraryModuleHandler ( FILE* fMakefile );
72 virtual bool CanHandleModule ( const Module& module ) const;
73 virtual void Process ( const Module& module );
74 private:
75 void GenerateStaticLibraryModuleTarget ( const Module& module );
76 };
77
78 #endif /* MINGW_MODULEHANDLER_H */