- if(dynamic_cast<ObjectFile *>(tgt))
- argv.push_back((*i)->get_name());
- else if(SharedLibrary *shlib=dynamic_cast<SharedLibrary *>(tgt))
- argv.push_back("-l"+shlib->get_libname());
- else if(dynamic_cast<StaticLibrary *>(tgt))
- argv.push_back((*i)->get_name());
- else if(SystemLibrary *syslib=dynamic_cast<SystemLibrary *>(tgt))
- argv.push_back("-l"+syslib->get_libname());
+ if(ObjectFile *obj = dynamic_cast<ObjectFile *>(tgt))
+ argv.push_back(relative(obj->get_path(), work_dir).str());
+ else if(StaticLibrary *stlib = dynamic_cast<StaticLibrary *>(tgt))
+ argv.push_back(stlib->get_path().str());
+ else if(Library *lib = dynamic_cast<Library *>(tgt))
+ argv.push_back("-l"+lib->get_libname());