[RTL]
[reactos.git] / reactos / tools / sysgen / SysGen.BuildEngine / Backends / Mingw / ModuleHandlers / MingwBuildToolModuleHandler.cs
1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 using SysGen.RBuild.Framework;
6
7 namespace SysGen.BuildEngine.Backends
8 {
9 public class MingwBuildToolModuleHandler : MingwRBuildModuleHandler
10 {
11 public MingwBuildToolModuleHandler(RBuildModule module)
12 : base(module)
13
14 {
15 }
16
17 protected override bool CanCompile(RBuildSourceFile file)
18 {
19 return (file.IsC || file.IsCPP);
20 }
21
22 protected override void WriteFileBuildInstructions(SourceFile sourceFile)
23 {
24 if (sourceFile.File.IsC)
25 {
26 WriteCCompiler(sourceFile);
27 }
28
29 if (sourceFile.File.IsCPP)
30 {
31 WriteCPPCompiler(sourceFile);
32 }
33 }
34
35 protected override void WriteLinker()
36 {
37 Makefile.WriteLine(Module.MakeFileTargetMacro + ": " + Module.MakeFileObjsMacro + " " + Module.MakeFileLinkDepsMacro + " | " + ModuleFolder.OutputFullPath);
38 Makefile.WriteLine("\t$(ECHO_LD)");
39 Makefile.WriteLine("\t" + Linker + " " + Module.MakeFileLFlagsMacro + " -o $@ " + Module.MakeFileObjsMacro + " " + Module.MakeFileLibsMacro );
40 Makefile.WriteLine();
41 }
42 }
43 }