[RTL]
[reactos.git] / reactos / tools / sysgen / SysGen.BuildEngine / Backends / Mingw / Misc / MakefileWriter.cs
1 using System;
2 using System.IO;
3 using System.Collections.Generic;
4 using System.Text;
5
6 namespace SysGen.BuildEngine.Backends
7 {
8 public class MakefileWriter : StreamWriter
9 {
10 public MakefileWriter(string path)
11 : base(path)
12 {
13 }
14
15 public void WriteComment(string text)
16 {
17 WriteLine("# {0}" , text);
18 }
19
20 public void WriteComplexComment(string text, params object[] args)
21 {
22 WriteComplexComment(string.Format(text, args));
23 }
24
25 public void WriteComplexComment(string text)
26 {
27 WriteLine();
28 WriteLine("#===================================================================================");
29 WriteLine("# {0}", text);
30 WriteLine("#===================================================================================");
31 WriteLine();
32 }
33
34 public void WriteIndentedLine(string text , params object[] args)
35 {
36 WriteIndentedLine(string.Format(text, args));
37 WriteLine();
38 }
39
40 public void WriteSingleLineIndented(string text)
41 {
42 WriteLine("\t{0}", text);
43 }
44
45 public void WriteIndentedLine(string text)
46 {
47 WriteLine("\t{0} \\", text);
48 }
49
50 public void WriteProperty(string propertyName , string propertyValue)
51 {
52 WriteLine("{0} := {1}" ,
53 propertyName ,
54 propertyValue);
55 }
56
57 public void WritePropertyAppend(string propertyName, string propertyValue)
58 {
59 WriteLine("{0} += {1}",
60 propertyName,
61 propertyValue);
62 }
63
64 public void WritePropertyAppendListStart(string propertyName)
65 {
66 WriteLine("{0} += \\", propertyName);
67 }
68
69 public void WritePropertyListStart(string propertyName)
70 {
71 WriteLine("{0} := \\", propertyName);
72 }
73
74 public void WritePropertyListEnd()
75 {
76 WriteLine();
77 }
78
79 public void WritePhonyTarget(string targetName)
80 {
81 WriteLine(".PHONY: {0}", targetName);
82 }
83
84 public void WriteSingleLineTarget(string targetName)
85 {
86 WriteLine("{0}:", targetName);
87 }
88
89 public void WriteTarget(string targetName)
90 {
91 WriteLine("{0}: \\", targetName);
92 }
93
94 public void WriteRule(string targetName , string targetName2)
95 {
96 WriteLine("{0}: {1}", targetName, targetName2);
97 }
98 }
99 }