1 #ifndef MINGW_MODULEHANDLER_H
2 #define MINGW_MODULEHANDLER_H
4 #include "../backend.h"
6 class MingwModuleHandler
9 static std::map
<const char*,MingwModuleHandler
*>* handler_map
;
11 MingwModuleHandler ( const char* moduletype_
);
12 virtual ~MingwModuleHandler() {}
14 static void SetMakefile ( FILE* f
);
15 static MingwModuleHandler
* LookupHandler ( const std::string
& moduletype_
);
16 virtual void Process ( const Module
& module
) = 0;
19 std::string
MingwModuleHandler::GetWorkingDirectory () const;
20 std::string
ReplaceExtension ( const std::string
& filename
,
21 const std::string
& newExtension
) const;
22 std::string
GetModuleArchiveFilename ( const Module
& module
) const;
23 std::string
GetImportLibraryDependencies ( const Module
& module
) const;
24 std::string
GetModuleDependencies ( const Module
& module
) const;
25 std::string
GetAllDependencies ( const Module
& module
) const;
26 std::string
GetSourceFilenames ( const Module
& module
) const;
28 std::string
GetObjectFilename ( const std::string
& sourceFilename
) const;
29 std::string
GetObjectFilenames ( const Module
& module
) const;
30 void GenerateObjectFileTargetsHost ( const Module
& module
) const;
31 void GenerateObjectFileTargetsTarget ( const Module
& module
) const;
32 void GenerateArchiveTargetHost ( const Module
& module
) const;
33 void GenerateArchiveTargetTarget ( const Module
& module
) const;
34 std::string
GetInvocationDependencies ( const Module
& module
) const;
35 std::string
GetInvocationParameters ( const Invoke
& invoke
) const;
36 void GenerateInvocations ( const Module
& module
) const;
37 void GeneratePreconditionDependencies ( const Module
& module
) const;
38 static FILE* fMakefile
;
40 std::string
ConcatenatePaths ( const std::string
& path1
,
41 const std::string
& path2
) const;
42 std::string
GenerateGccDefineParametersFromVector ( const std::vector
<Define
*>& defines
) const;
43 std::string
GenerateGccDefineParameters ( const Module
& module
) const;
44 std::string
GenerateGccIncludeParametersFromVector ( const std::vector
<Include
*>& includes
) const;
45 std::string
GenerateGccIncludeParameters ( const Module
& module
) const;
46 std::string
GenerateGccParameters ( const Module
& module
) const;
47 void GenerateObjectFileTargets ( const Module
& module
,
48 const std::string
& cc
) const;
49 void GenerateArchiveTarget ( const Module
& module
,
50 const std::string
& ar
) const;
51 std::string
GetPreconditionDependenciesName ( const Module
& module
) const;
55 class MingwBuildToolModuleHandler
: public MingwModuleHandler
58 MingwBuildToolModuleHandler ();
59 virtual void Process ( const Module
& module
);
61 void GenerateBuildToolModuleTarget ( const Module
& module
);
65 class MingwKernelModuleHandler
: public MingwModuleHandler
68 MingwKernelModuleHandler ();
69 virtual void Process ( const Module
& module
);
71 void GenerateKernelModuleTarget ( const Module
& module
);
75 class MingwStaticLibraryModuleHandler
: public MingwModuleHandler
78 MingwStaticLibraryModuleHandler ();
79 virtual void Process ( const Module
& module
);
81 void GenerateStaticLibraryModuleTarget ( const Module
& module
);
84 #endif /* MINGW_MODULEHANDLER_H */