3 using System.Diagnostics;
7 public class LinuxBuilder : ABuilder
9 public LinuxBuilder(Config _cfg)
14 public override string GetPawnCompilerName()
19 public override bool BuildLibrary(Package pkg, Library lib)
21 ProcessStartInfo info = new ProcessStartInfo();
23 string path = Config.PathFormat("{0}/{1}",
27 /* PlatformExt ignored for us */
28 string binName = lib.binary_name;
30 if (!lib.is_executable)
32 if (lib.has_platform_ext)
34 binName += "_i486.so";
42 string binpath = Config.PathFormat("{0}/{1}/{2}",
44 (lib.release_mode == ReleaseMode.ReleaseMode_Release) ? "Release" : "Debug",
47 if (File.Exists(binpath))
52 string makefile_name = "Makefile";
54 if (lib.build_mode == BuildMode.BuildMode_Episode1)
56 makefile_name = "Makefile.ep1";
58 else if (lib.build_mode == BuildMode.BuildMode_Episode2)
60 makefile_name = "Makefile.ep2";
62 else if (lib.build_mode == BuildMode.BuildMode_OldMetamod)
64 makefile_name = "Makefile.orig";
67 /* Clean the project first */
68 info.WorkingDirectory = path;
69 info.FileName = cfg.builder_path;
70 info.Arguments = "-f " + makefile_name + " clean";
71 info.UseShellExecute = false;
73 Process p = Process.Start(info);
78 info.WorkingDirectory = path;
79 info.FileName = cfg.builder_path;
80 info.Arguments = "-f " + makefile_name;
81 info.UseShellExecute = false;
83 if (cfg.build_options != null)
85 info.Arguments += " " + cfg.build_options;
88 p = Process.Start(info);
92 if (!File.Exists(binpath))
97 path = Config.PathFormat("{0}/{1}/{2}/{3}",
102 File.Copy(binpath, path, true);