#include <msp/core/getopt.h>
#include <msp/datafile/parser.h>
#include <msp/fs/dir.h>
#include <msp/fs/stat.h>
#include <msp/fs/utils.h>
#include <msp/io/buffered.h>
#include <msp/core/getopt.h>
#include <msp/datafile/parser.h>
#include <msp/fs/dir.h>
#include <msp/fs/stat.h>
#include <msp/fs/utils.h>
#include <msp/io/buffered.h>
#include <msp/strings/regex.h>
#include <msp/strings/utils.h>
#include <msp/time/units.h>
#include <msp/strings/regex.h>
#include <msp/strings/utils.h>
#include <msp/time/units.h>
getopt.add_option('j', "jobs", jobs, GetOpt::REQUIRED_ARG).set_help("Run NUM commands at once, whenever possible.", "NUM");
getopt.add_option('n', "dry-run", dry_run, GetOpt::NO_ARG).set_help("Don't actually do anything, only show what would be done.");
getopt.add_option('v', "verbose", verbose, GetOpt::NO_ARG).set_help("Print more information about what's going on.");
getopt.add_option('j', "jobs", jobs, GetOpt::REQUIRED_ARG).set_help("Run NUM commands at once, whenever possible.", "NUM");
getopt.add_option('n', "dry-run", dry_run, GetOpt::NO_ARG).set_help("Don't actually do anything, only show what would be done.");
getopt.add_option('v', "verbose", verbose, GetOpt::NO_ARG).set_help("Print more information about what's going on.");
getopt.add_option('A', "conf-all", conf_all, GetOpt::NO_ARG).set_help("Apply configuration to all packages.");
getopt.add_option('B', "build-all", build_all, GetOpt::NO_ARG).set_help("Build all targets unconditionally.");
getopt.add_option('C', "chdir", work_dir, GetOpt::REQUIRED_ARG).set_help("Change to DIR before doing anything else.", "DIR");
getopt.add_option('A', "conf-all", conf_all, GetOpt::NO_ARG).set_help("Apply configuration to all packages.");
getopt.add_option('B', "build-all", build_all, GetOpt::NO_ARG).set_help("Build all targets unconditionally.");
getopt.add_option('C', "chdir", work_dir, GetOpt::REQUIRED_ARG).set_help("Change to DIR before doing anything else.", "DIR");
if(verbose>=2)
{
IO::print("Building on %s, for %s%s\n", native_arch.get_name(),
current_arch->get_name(), (current_arch->is_native() ? " (native)" : ""));
IO::print("Prefix is %s\n", prefix);
}
if(verbose>=2)
{
IO::print("Building on %s, for %s%s\n", native_arch.get_name(),
current_arch->get_name(), (current_arch->is_native() ? " (native)" : ""));
IO::print("Prefix is %s\n", prefix);
}
- IO::print("%d active packages, %d targets\n", all_reqs.size(), targets.size());
+ {
+ unsigned n_packages = 0;
+ for(PackageMap::const_iterator i=packages.begin(); i!=packages.end(); ++i)
+ if(i->second && i->second->is_configured())
+ ++n_packages;
+ IO::print("%d active packages, %d targets\n", n_packages, targets.size());
+ }
+
- IO::print(" %s", (*i)->get_name());
- if(dynamic_cast<SourcePackage *>(*i))
+ if(!i->second->is_configured())
+ continue;
+
+ IO::print(" %s", i->second->get_name());
+ if(dynamic_cast<SourcePackage *>(i->second))
+FileTarget *Builder::get_target_by_path(const FS::Path &p) const
+{
+ TargetMap::const_iterator i = targets_by_path.find(p.str());
+ if(i!=targets_by_path.end())
+ return static_cast<FileTarget *>(i->second);
+ return 0;
+}
+
Target *tarballs = new VirtualTarget(*this, "tarballs");
world->add_depend(tarballs);
Target *tarballs = new VirtualTarget(*this, "tarballs");
world->add_depend(tarballs);
// Make the cmdline target depend on all targets mentioned on the command line
Target *cmdline = new VirtualTarget(*this, "cmdline");
// Make the cmdline target depend on all targets mentioned on the command line
Target *cmdline = new VirtualTarget(*this, "cmdline");
for(list<string>::iterator i=cmdline_targets.begin(); i!=cmdline_targets.end(); ++i)
{
Target *tgt = get_target(*i);
if(!tgt)
for(list<string>::iterator i=cmdline_targets.begin(); i!=cmdline_targets.end(); ++i)
{
Target *tgt = get_target(*i);
if(!tgt)