X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuilder.cpp;h=0905bb6779530af63a6fd2f25151cf4248609715;hb=4629d189a531c962cf15a511df787f30c3adcb02;hp=7135a8d97b1a42a4e6aa24860ade31c32fa4f9b4;hpb=83d2a8a39e0a09733ffc666d7f885fc328b831f2;p=builder.git diff --git a/source/builder.cpp b/source/builder.cpp index 7135a8d..0905bb6 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -258,19 +258,19 @@ int Builder::main() if(dynamic_cast(*i)) IO::print("*"); unsigned count=0; - unsigned ood_count=0; + unsigned to_be_built=0; for(TargetMap::iterator j=targets.begin(); j!=targets.end(); ++j) if(j->second->get_package()==*i) { ++count; if(j->second->get_rebuild()) - ++ood_count; + ++to_be_built; } if(count) { IO::print(" (%d targets", count); - if(ood_count) - IO::print(", %d out-of-date", ood_count); + if(to_be_built) + IO::print(", %d to be built", to_be_built); IO::print(")"); } IO::print("\n"); @@ -285,7 +285,8 @@ int Builder::main() IO::print(IO::cerr, "The following problems were detected:\n"); for(ProblemList::iterator i=problems.begin(); i!=problems.end(); ++i) IO::print(IO::cerr, " %s: %s\n", i->package, i->descr); - IO::print(IO::cerr, "Please fix them and try again.\n"); + if(!analyzer) + IO::print(IO::cerr, "Please fix them and try again.\n"); return 1; } @@ -640,18 +641,7 @@ int Builder::create_targets() cmdline->add_depend(tgt); } - /* If world is to be built, prepare cmdline. If not, add cmdline to world - and prepare world. I don't really like this, but it keeps the graph - acyclic. - - XXX Could we skip preparing targets we are not interested in? */ - if(build_world) - cmdline->prepare(); - else - { - world->add_depend(cmdline); - world->prepare(); - } + cmdline->prepare(); for(PackageMap::iterator i=packages.begin(); i!=packages.end(); ++i) if(SourcePackage *spkg=dynamic_cast(i->second)) @@ -727,7 +717,11 @@ int Builder::do_build() { Target *cmdline=get_target("cmdline"); - unsigned total=cmdline->count_rebuild(); + unsigned total=0; + for(map::const_iterator i=targets.begin(); i!=targets.end(); ++i) + if(i->second->is_buildable() && i->second->get_rebuild()) + ++total; + if(!total) { IO::print("Already up to date\n");