1 #ifndef MINGW_MODULEHANDLER_H
2 #define MINGW_MODULEHANDLER_H
4 #include "../backend.h"
6 class MingwModuleHandler
9 static std::map
<ModuleType
,MingwModuleHandler
*>* handler_map
;
12 MingwModuleHandler ( ModuleType moduletype
);
13 virtual ~MingwModuleHandler();
15 static void SetMakefile ( FILE* f
);
16 static MingwModuleHandler
* LookupHandler ( const std::string
& location
,
17 ModuleType moduletype_
);
18 virtual void Process ( const Module
& module
) = 0;
21 std::string
GetWorkingDirectory () const;
22 std::string
GetExtension ( const std::string
& filename
) const;
23 std::string
ReplaceExtension ( const std::string
& filename
,
24 const std::string
& newExtension
) const;
25 std::string
GetModuleArchiveFilename ( const Module
& module
) const;
26 std::string
GetImportLibraryDependencies ( const Module
& module
) const;
27 std::string
GetModuleDependencies ( const Module
& module
) const;
28 std::string
GetAllDependencies ( const Module
& module
) const;
29 std::string
GetSourceFilenames ( const Module
& module
) const;
31 std::string
GetObjectFilename ( const std::string
& sourceFilename
) const;
32 std::string
GetObjectFilenames ( const Module
& module
) const;
33 void GenerateObjectFileTargetsHost ( const Module
& module
) const;
34 void GenerateObjectFileTargetsTarget ( const Module
& module
) const;
35 void GenerateArchiveTargetHost ( const Module
& module
) const;
36 void GenerateArchiveTargetTarget ( const Module
& module
) const;
37 std::string
GetInvocationDependencies ( const Module
& module
) const;
38 std::string
GetInvocationParameters ( const Invoke
& invoke
) const;
39 void GenerateInvocations ( const Module
& module
) const;
40 void GeneratePreconditionDependencies ( const Module
& module
) const;
41 std::string
GenerateObjectList ( const Module
& module
) const;
42 static FILE* fMakefile
;
44 std::string
ConcatenatePaths ( const std::string
& path1
,
45 const std::string
& path2
) const;
46 std::string
GenerateGccDefineParametersFromVector ( const std::vector
<Define
*>& defines
) const;
47 std::string
GenerateGccDefineParameters ( const Module
& module
) const;
48 std::string
GenerateGccIncludeParametersFromVector ( const std::vector
<Include
*>& includes
) const;
49 void GenerateGccModuleIncludeVariable ( const Module
& module
) const;
50 std::string
GenerateGccIncludeParameters ( const Module
& module
) const;
51 std::string
GenerateGccParameters ( const Module
& module
) const;
52 std::string
GenerateNasmParameters ( const Module
& module
) const;
53 std::string
GenerateGccCommand ( const Module
& module
,
54 const std::string
& sourceFilename
,
55 const std::string
& cc
) const;
56 std::string
GenerateGccAssemblerCommand ( const Module
& module
,
57 const std::string
& sourceFilename
,
58 const std::string
& cc
) const;
59 std::string
GenerateNasmCommand ( const Module
& module
,
60 const std::string
& sourceFilename
) const;
61 std::string
GenerateCommand ( const Module
& module
,
62 const std::string
& sourceFilename
,
63 const std::string
& cc
) const;
64 void GenerateObjectFileTargets ( const Module
& module
,
65 const std::string
& cc
) const;
66 void GenerateArchiveTarget ( const Module
& module
,
67 const std::string
& ar
) const;
68 std::string
GetPreconditionDependenciesName ( const Module
& module
) const;
72 class MingwBuildToolModuleHandler
: public MingwModuleHandler
75 MingwBuildToolModuleHandler ();
76 virtual void Process ( const Module
& module
);
78 void GenerateBuildToolModuleTarget ( const Module
& module
);
82 class MingwKernelModuleHandler
: public MingwModuleHandler
85 MingwKernelModuleHandler ();
86 virtual void Process ( const Module
& module
);
88 void GenerateKernelModuleTarget ( const Module
& module
);
92 class MingwStaticLibraryModuleHandler
: public MingwModuleHandler
95 MingwStaticLibraryModuleHandler ();
96 virtual void Process ( const Module
& module
);
98 void GenerateStaticLibraryModuleTarget ( const Module
& module
);
102 class MingwKernelModeDLLModuleHandler
: public MingwModuleHandler
105 MingwKernelModeDLLModuleHandler ();
106 virtual void Process ( const Module
& module
);
108 void GenerateKernelModeDLLModuleTarget ( const Module
& module
);
111 #endif /* MINGW_MODULEHANDLER_H */