#include "pkgconfiggenerator.h"
#include "sharedlibrary.h"
#include "sourcepackage.h"
-#include "systemlibrary.h"
#include "tar.h"
#include "task.h"
#include "virtualtarget.h"
if(j->second->get_package()==i->second)
{
++count;
- if(j->second->get_rebuild())
+ if(j->second->needs_rebuild())
++to_be_built;
}
if(count)
}
}
- // Find dependencies until no new targets are created
- while(!new_tgts.empty())
- {
- Target *tgt = new_tgts.front();
- new_tgts.erase(new_tgts.begin());
- tgt->find_depends();
- if(!tgt->get_depends_ready())
- new_tgts.push_back(tgt);
- }
-
// Apply what-ifs
+ // XXX This does not currently work with targets found during dependency discovery
for(StringList::iterator i=what_if.begin(); i!=what_if.end(); ++i)
{
FileTarget *tgt = vfs.get_target(cwd/ *i);
unsigned total = 0;
for(map<string, Target *>::const_iterator i=targets.begin(); i!=targets.end(); ++i)
- if(i->second->is_buildable() && i->second->get_rebuild())
+ if(i->second->is_buildable() && i->second->needs_rebuild())
++total;
if(!total)
if(tgt)
{
if(tgt->get_tool())
- IO::print("[%-10s] [%-4s] %s\n", tgt->get_package()->get_name(), tgt->get_tool()->get_tag(), tgt->get_name());
+ IO::print("%-4s %s\n", tgt->get_tool()->get_tag(), tgt->get_name());
Task *task = tgt->build();
if(task)
tasks.push_back(task);
for(set<Target *>::iterator i=clean_tgts.begin(); i!=clean_tgts.end(); ++i)
if(FileTarget *ft = dynamic_cast<FileTarget *>(*i))
- unlink(ft->get_path());
+ if(ft->get_mtime())
+ FS::unlink(ft->get_path());
return 0;
}