1.1 --- a/tools/builder/LinuxBuilder.cs Sun Oct 14 18:53:29 2007 +0000
1.2 +++ b/tools/builder/LinuxBuilder.cs Sun Oct 14 18:55:49 2007 +0000
1.3 @@ -16,52 +16,20 @@
1.4 return "spcomp";
1.5 }
1.6
1.7 - public override string CompressPackage(Package pkg)
1.8 - {
1.9 - string lpath = null, ltarget = null;
1.10 -
1.11 - pkg.GetCompressBases(ref lpath, ref ltarget);
1.12 -
1.13 - string local_dir = Config.PathFormat("{0}/{1}",
1.14 - cfg.OutputBase,
1.15 - lpath);
1.16 -
1.17 - string name = PackageBuildName(pkg) + ".tar.gz";
1.18 -
1.19 - ProcessStartInfo info = new ProcessStartInfo();
1.20 - info.FileName = cfg.Compressor;
1.21 - info.WorkingDirectory = local_dir;
1.22 - info.Arguments = "zcvf \"" + name + "\" \"" + ltarget + "\"";
1.23 - info.UseShellExecute = false;
1.24 -
1.25 - Process p = Process.Start(info);
1.26 - p.WaitForExit();
1.27 -
1.28 - local_dir = Config.PathFormat("{0}/{1}", local_dir, name);
1.29 -
1.30 - if (!File.Exists(local_dir))
1.31 - {
1.32 - return null;
1.33 - }
1.34 -
1.35 - return name;
1.36 - }
1.37 -
1.38 -
1.39 public override bool BuildLibrary(Package pkg, Library lib, ref string _binName, ref string _binPath)
1.40 {
1.41 ProcessStartInfo info = new ProcessStartInfo();
1.42
1.43 string path = Config.PathFormat("{0}/{1}",
1.44 - cfg.SourceBase,
1.45 - lib.LocalPath);
1.46 + cfg.source_path,
1.47 + lib.source_path);
1.48
1.49 /* PlatformExt ignored for us */
1.50 - string binName = lib.Name;
1.51 + string binName = lib.binary_name;
1.52
1.53 - if (!lib.IsExecutable)
1.54 + if (!lib.is_executable)
1.55 {
1.56 - if (lib.PlatformExt)
1.57 + if (lib.has_platform_ext)
1.58 {
1.59 binName += "_i486.so";
1.60 }
1.61 @@ -73,7 +41,7 @@
1.62
1.63 string binpath = Config.PathFormat("{0}/{1}/{2}",
1.64 path,
1.65 - lib.ReleaseBuild,
1.66 + (lib.release_mode == ReleaseMode.ReleaseMode_Release) ? "Release" : "Debug",
1.67 binName);
1.68
1.69 if (File.Exists(binpath))
1.70 @@ -81,10 +49,25 @@
1.71 File.Delete(binpath);
1.72 }
1.73
1.74 + string makefile_name = "Makefile";
1.75 +
1.76 + if (lib.build_mode == BuildMode.BuildMode_Episode1)
1.77 + {
1.78 + makefile_name = "Makefile.ep1";
1.79 + }
1.80 + else if (lib.build_mode == BuildMode.BuildMode_Episode2)
1.81 + {
1.82 + makefile_name = "Makefile.ep2";
1.83 + }
1.84 + else if (lib.build_mode == BuildMode.BuildMode_OldMetamod)
1.85 + {
1.86 + makefile_name = "Makefile.orig";
1.87 + }
1.88 +
1.89 /* Clean the project first */
1.90 info.WorkingDirectory = path;
1.91 - info.FileName = cfg.BuilderPath;
1.92 - info.Arguments = "clean";
1.93 + info.FileName = cfg.builder_path;
1.94 + info.Arguments = "-f " + makefile_name + " clean";
1.95 info.UseShellExecute = false;
1.96
1.97 Process p = Process.Start(info);
1.98 @@ -93,13 +76,13 @@
1.99
1.100 /* Now build it */
1.101 info.WorkingDirectory = path;
1.102 - info.FileName = cfg.BuilderPath;
1.103 - info.Arguments = "";
1.104 + info.FileName = cfg.builder_path;
1.105 + info.Arguments = "-f " + makefile_name;
1.106 info.UseShellExecute = false;
1.107
1.108 - if (cfg.BuildOptions != null)
1.109 + if (cfg.build_options != null)
1.110 {
1.111 - info.Arguments += " " + cfg.BuildOptions;
1.112 + info.Arguments += " " + cfg.build_options;
1.113 }
1.114
1.115 p = Process.Start(info);