Added preliminary support for Left 4 Dead; some things may not yet work.
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 output_folder = (lib.release_mode == ReleaseMode.ReleaseMode_Release) ? "Release" : "Debug";
44 if (lib.build_mode == BuildMode.BuildMode_Episode2)
46 output_folder += ".orangebox";
48 else if (lib.build_mode == BuildMode.BuildMode_OldMetamod)
50 output_folder += ".original";
52 else if (lib.build_mode == BuildMode.BuildMode_Left4Dead)
54 output_folder += ".left4dead";
57 string binpath = Config.PathFormat("{0}/{1}/{2}",
62 if (File.Exists(binpath))
67 string makefile_args = "";
69 if (lib.build_mode == BuildMode.BuildMode_Episode1)
73 else if (lib.build_mode == BuildMode.BuildMode_Episode2)
75 makefile_args = "ENGINE=\"orangebox\"";
77 else if (lib.build_mode == BuildMode.BuildMode_OldMetamod)
79 makefile_args = "ENGINE=\"original\"";
81 else if (lib.build_mode == BuildMode.BuildMode_Left4Dead)
83 makefile_args = "ENGINE=\"left4dead\"";
86 /* Clean the project first */
87 info.WorkingDirectory = path;
88 info.FileName = cfg.builder_path;
89 info.Arguments = makefile_args + " clean";
90 info.UseShellExecute = false;
92 Process p = Process.Start(info);
97 info.WorkingDirectory = path;
98 info.FileName = cfg.builder_path;
99 info.Arguments = makefile_args;
100 info.UseShellExecute = false;
102 if (cfg.build_options != null)
104 info.Arguments += " " + cfg.build_options;
107 p = Process.Start(info);
111 if (!File.Exists(binpath))
116 path = Config.PathFormat("{0}/{1}/{2}/{3}",
121 File.Copy(binpath, path, true);