]> git.tdb.fi Git - builder.git/blobdiff - source/staticlibrary.cpp
Split Binary filename generation to Executable and SharedLibrary
[builder.git] / source / staticlibrary.cpp
index b61f70a03333a59256590559c7ad6495fceb94e4..f6c8e56e49fc409382e0b7c399340eb6fa60ad1e 100644 (file)
@@ -1,27 +1,29 @@
-#include "archive.h"
+#include "builder.h"
 #include "component.h"
 #include "objectfile.h"
 #include "sourcepackage.h"
 #include "staticlibrary.h"
 
 using namespace std;
+using namespace Msp;
+
+StaticLibrary::StaticLibrary(Builder &b, const FS::Path &p):
+       FileTarget(b, 0, p)
+{ }
 
 StaticLibrary::StaticLibrary(Builder &b, const Component &c, const list<ObjectFile *> &objs):
-       FileTarget(b, &c.get_package(), generate_target_path(c)),
-       Library(b, package, path, c.get_name()),
-       comp(c)
+       FileTarget(b, &c.get_package(), generate_target_path(c))
 {
-       buildable = true;
+       component = &c;
        for(list<ObjectFile *>::const_iterator i=objs.begin(); i!=objs.end(); ++i)
                add_depend(*i);
-}
 
-Action *StaticLibrary::create_action()
-{
-       return new Archive(builder, *this);
+       install_location = "lib";
 }
 
 Msp::FS::Path StaticLibrary::generate_target_path(const Component &c)
 {
-       return c.get_package().get_out_dir()/("lib"+c.get_name()+".a");
+       const Architecture &arch = c.get_package().get_builder().get_current_arch();
+       return c.get_package().get_out_dir()/
+               arch.get_static_library_patterns().front().apply(c.get_name());
 }