From db3534da1bcbf286df7ac4c8736f5c5157399ced Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 17 Jul 2016 08:18:45 +0200 Subject: Redesign obj to exe/lib mapping Specifically: * objso{} and libso{} target types have been renamed to objs{} and libs{} * obje{} has been added (so now we have obje{}, obja{}, and objs{}) * obje{} is now used for building exe{} * object file extensions have been changed to use "hierarchical extensions" that reflect the extension of the corresponding exe/lib target (instead of the -so suffix we used), specifically: obje{}: foo.o, (UNIX), foo.exe.o (MinGW), foo.exe.obj (Windows) obja{}: foo.a.o (UNIX, MinGW), foo.lib.obj (Windows) objs{}: foo.so.o (UNIX), foo.dylib.o (Darwin), foo.dll.o (MinGW), foo.dll.obj (Windows) --- build2/bin/module.cxx | 51 ++++++++++++++++++++++++++------------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'build2/bin/module.cxx') diff --git a/build2/bin/module.cxx b/build2/bin/module.cxx index 306d8de..334384a 100644 --- a/build2/bin/module.cxx +++ b/build2/bin/module.cxx @@ -31,7 +31,7 @@ namespace build2 // static const strings exe_lib {"shared", "static"}; static const strings liba_lib {"static"}; - static const strings libso_lib {"shared"}; + static const strings libs_lib {"shared"}; // Apply the specified stem to the config.bin.pattern. If there is no // pattern, then return the stem itself. Assume the pattern is valid, @@ -73,22 +73,22 @@ namespace build2 // Note: some overridable, some not. // - v.insert ("config.bin.target", true); - v.insert ("config.bin.pattern", true); + v.insert ("config.bin.target", true); + v.insert ("config.bin.pattern", true); - v.insert ("config.bin.ar", true); - v.insert ("config.bin.ranlib", true); + v.insert ("config.bin.ar", true); + v.insert ("config.bin.ranlib", true); - v.insert ("config.bin.lib", true); - v.insert ("config.bin.exe.lib", true); - v.insert ("config.bin.liba.lib", true); - v.insert ("config.bin.libso.lib", true); - v.insert ("config.bin.rpath", true); + v.insert ("config.bin.lib", true); + v.insert ("config.bin.exe.lib", true); + v.insert ("config.bin.liba.lib", true); + v.insert ("config.bin.libs.lib", true); + v.insert ("config.bin.rpath", true); v.insert ("bin.lib"); v.insert ("bin.exe.lib"); v.insert ("bin.liba.lib"); - v.insert ("bin.libso.lib"); + v.insert ("bin.libs.lib"); v.insert ("bin.rpath"); v.insert ("bin.libprefix", true); @@ -133,12 +133,12 @@ namespace build2 v = required (r, "config.bin.liba.lib", liba_lib).first; } - // config.bin.libso.lib + // config.bin.libs.lib // { - value& v (b.assign ("bin.libso.lib")); + value& v (b.assign ("bin.libs.lib")); if (!v) - v = required (r, "config.bin.libso.lib", libso_lib).first; + v = required (r, "config.bin.libs.lib", libs_lib).first; } // config.bin.rpath @@ -353,13 +353,14 @@ namespace build2 { auto& t (b.target_types); - t.insert (); - t.insert (); - t.insert (); - t.insert (); - t.insert (); - t.insert (); - t.insert (); + t.insert (); + t.insert (); + t.insert (); + t.insert (); + t.insert (); + t.insert (); + t.insert (); + t.insert (); } // Register rules. @@ -407,15 +408,15 @@ namespace build2 // And a library that wants to override any such overrides (e.g., // because it does have main()) can do: // - // libso{foo}: install.mode=755 + // libs{foo}: install.mode=755 // // Everyone is happy then? Not Windows users. When targeting Windows - // libso{} is an import library and shouldn't be exec. + // libs{} is an import library and shouldn't be exec. // - install_path (b, dir_path ("lib")); // Install into install.lib. + install_path (b, dir_path ("lib")); // Install into install.lib. if (tclass == "windows") - install_mode (b, "644"); + install_mode (b, "644"); install_path (b, dir_path ("lib")); // Install into install.lib. install_mode (b, "644"); -- cgit v1.1