4 #include "../backend.h"
9 #define NUL "/dev/null"
13 class MingwModuleHandler
;
16 v2s ( const string_list
& v
, int wrap_at
);
18 typedef std::map
<std::string
,Directory
*> directory_map
;
24 static std::string
GetVariable ( const std::string
& name
);
32 directory_map subdirs
;
33 Directory ( const std::string
& name
);
34 void Add ( const char* subdir
);
35 void GenerateTree ( const std::string
& parent
,
38 bool mkdir_p ( const char* path
);
39 std::string
ReplaceVariable ( std::string name
,
42 std::string
GetEnvironmentVariable ( const std::string
& name
);
43 std::string
GetEnvironmentVariablePathOrDefault ( const std::string
& name
,
44 const std::string
& defaultValue
);
45 std::string
GetIntermediatePath ();
46 std::string
GetOutputPath ();
47 std::string
GetInstallPath ();
48 void ResolveVariablesInPath ( char* buf
,
50 bool CreateDirectory ( std::string path
);
54 class MingwBackend
: public Backend
57 MingwBackend ( Project
& project
,
60 virtual ~MingwBackend ();
61 virtual void Process ();
62 std::string
AddDirectoryTarget ( const std::string
& directory
,
63 Directory
* directoryTree
);
64 std::string compilerCommand
;
66 Directory
* intermediateDirectory
;
67 Directory
* outputDirectory
;
68 Directory
* installDirectory
;
70 void CreateMakefile ();
71 void CloseMakefile () const;
72 void GenerateHeader () const;
73 void GenerateProjectCFlagsMacro ( const char* assignmentOperation
,
74 IfableData
& data
) const;
75 void GenerateGlobalCFlagsAndProperties ( const char* op
,
76 IfableData
& data
) const;
77 std::string
GenerateProjectLFLAGS () const;
78 void GenerateDirectories ();
79 void GenerateGlobalVariables () const;
80 bool IncludeInAllTarget ( const Module
& module
) const;
81 void GenerateAllTarget ( const std::vector
<MingwModuleHandler
*>& handlers
) const;
82 std::string
GetBuildToolDependencies () const;
83 void GenerateInitTarget () const;
84 void GenerateXmlBuildFilesMacro() const;
85 void CheckAutomaticDependencies ();
86 bool IncludeDirectoryTarget ( const std::string
& directory
) const;
87 bool TryToDetectThisCompiler ( const std::string
& compiler
);
88 void DetectCompiler ();
89 void DetectPipeSupport ();
90 void DetectPCHSupport ();
91 void ProcessModules ();
92 std::string
GetNonModuleInstallDirectories ( const std::string
& installDirectory
);
93 std::string
GetInstallDirectories ( const std::string
& installDirectory
);
94 void GetNonModuleInstallFiles ( std::vector
<std::string
>& out
) const;
95 void GetInstallFiles ( std::vector
<std::string
>& out
) const;
96 void GetNonModuleInstallTargetFiles ( std::vector
<std::string
>& out
) const;
97 void GetModuleInstallTargetFiles ( std::vector
<std::string
>& out
) const;
98 void GetInstallTargetFiles ( std::vector
<std::string
>& out
) const;
99 void OutputInstallTarget ( const std::string
& sourceFilename
,
100 const std::string
& targetFilename
,
101 const std::string
& targetDirectory
);
102 void OutputNonModuleInstallTargets ();
103 void OutputModuleInstallTargets ();
104 std::string
GetRegistrySourceFiles ();
105 std::string
GetRegistryTargetFiles ();
106 void OutputRegistryInstallTarget ();
107 void GenerateInstallTarget ();