Don't count virtual targets when reporting the number of targets to be built
Make the Copy action behave correctly in a dry run
Report the number of out-of-date targets per package with --verbose
{
ostringstream line;
line<<left;
{
ostringstream line;
line<<left;
- line<<'['<<setw(10)<<pkg<<"] ";
+ line<<'['<<setw(10)<<pkg.substr(0, 10)<<"] ";
line<<'['<<setw(4)<<tool<<"] ";
line<<tgt;
cout<<line.str()<<'\n';
line<<'['<<setw(4)<<tool<<"] ";
line<<tgt;
cout<<line.str()<<'\n';
jobs=max(strtol(getopt['j'].arg()), 1L);
jobs=max(strtol(getopt['j'].arg()), 1L);
+ build_file=getopt['f'].arg();
+ build_all=getopt['B'];
if(getopt['C'])
chdir(getopt['C'].arg().c_str());
if(getopt['C'])
chdir(getopt['C'].arg().c_str());
- build_file=getopt['f'].arg();
-
for(int i=index; i<argc; ++i)
{
string v(argv[i]);
for(int i=index; i<argc; ++i)
{
string v(argv[i]);
if(i->second->get_buildable())
cout<<'*';
unsigned count=0;
if(i->second->get_buildable())
cout<<'*';
unsigned count=0;
for(TargetMap::iterator j=targets.begin(); j!=targets.end(); ++j)
if(j->second->get_package()==i->second)
for(TargetMap::iterator j=targets.begin(); j!=targets.end(); ++j)
if(j->second->get_package()==i->second)
- cout<<" ("<<count<<" targets)\n";
+ if(j->second->get_rebuild())
+ ++ood_count;
+ }
+ if(count)
+ {
+ cout<<" ("<<count<<" targets";
+ if(ood_count)
+ cout<<", "<<ood_count<<" out-of-date";
+ cout<<")\n";
+ }
Builder(int, char **);
unsigned get_verbose() const { return verbose; }
bool get_dry_run() const { return dry_run; }
Builder(int, char **);
unsigned get_verbose() const { return verbose; }
bool get_dry_run() const { return dry_run; }
+ bool get_build_all() const { return build_all; }
Package *get_package(const std::string &);
Target *get_target(const std::string &);
Target *get_header(const std::string &, const std::string &, const std::list<std::string> &);
Package *get_package(const std::string &);
Target *get_target(const std::string &);
Target *get_header(const std::string &, const std::string &, const std::list<std::string> &);
std::list<std::string> what_if;
bool chrome;
bool conf_all;
std::list<std::string> what_if;
bool chrome;
bool conf_all;
int load_build_file(const Msp::Path::Path &);
int create_targets();
int load_build_file(const Msp::Path::Path &);
int create_targets();
int Copy::check()
{
if(!worker)
int Copy::check()
{
if(!worker)
+ {
+ signal_done.emit();
+ if(builder.get_build_all())
+ mark_rebuild("Rebuilding everything");
+ else if(!mtime)
mark_rebuild("Does not exist");
else
{
mark_rebuild("Does not exist");
else
{
virtual void prepare();
virtual Action *build()=0;
void reset_count() { counted=false; }
virtual void prepare();
virtual Action *build()=0;
void reset_count() { counted=false; }
- unsigned count_rebuild();
+ virtual unsigned count_rebuild();
void touch();
virtual ~Target() { }
protected:
void touch();
virtual ~Target() { }
protected:
if((*i)->get_rebuild())
mark_rebuild(Msp::Path::basename((*i)->get_name())+" needs rebuilding");
}
if((*i)->get_rebuild())
mark_rebuild(Msp::Path::basename((*i)->get_name())+" needs rebuilding");
}
+
+unsigned VirtualTarget::count_rebuild()
+{
+ return Target::count_rebuild()-rebuild;
+}
VirtualTarget(Builder &b, const std::string &n): Target(b,0,n) { }
const char *get_type() const { return "VirtualTarget"; }
Action *build() { rebuild=false; return 0; }
VirtualTarget(Builder &b, const std::string &n): Target(b,0,n) { }
const char *get_type() const { return "VirtualTarget"; }
Action *build() { rebuild=false; return 0; }
+ unsigned count_rebuild();
private:
void check_rebuild();
};
private:
void check_rebuild();
};