GetOpt getopt;
getopt.add_option('a', "analyze", analyze_mode, GetOpt::REQUIRED_ARG).set_help("Perform dependency analysis.", "MODE");
GetOpt getopt;
getopt.add_option('a', "analyze", analyze_mode, GetOpt::REQUIRED_ARG).set_help("Perform dependency analysis.", "MODE");
- getopt.add_option('b', "build", build, GetOpt::NO_ARG).set_help("Perform build even if doing analysis.");
+ getopt.add_option('b', "build", build, GetOpt::NO_ARG).set_help("Perform build even if also doing something else.");
getopt.add_option('c', "clean", clean, GetOpt::NO_ARG).set_help("Clean buildable targets.");
getopt.add_option('f', "file", build_file, GetOpt::REQUIRED_ARG).set_help("Read build instructions from FILE.", "FILE");
getopt.add_option('h', "help", help, GetOpt::NO_ARG).set_help("Print this message.");
getopt.add_option('c', "clean", clean, GetOpt::NO_ARG).set_help("Clean buildable targets.");
getopt.add_option('f', "file", build_file, GetOpt::REQUIRED_ARG).set_help("Read build instructions from FILE.", "FILE");
getopt.add_option('h', "help", help, GetOpt::NO_ARG).set_help("Print this message.");
- load_build_file((FS::get_sys_data_dir(argv[0], "builder")/"builderrc").str());
- load_build_file((FS::get_user_data_dir("builder")/"rc").str());
+ list<FS::Path> start_files;
+ start_files.push_back(FS::get_sys_data_dir(argv[0], "builder")/"builderrc");
+ start_files.push_back(FS::get_user_data_dir("builder")/"rc");
+ for(list<FS::Path>::const_iterator i=start_files.begin(); i!=start_files.end(); ++i)
+ if(FS::exists(*i))
+ load_build_file(*i);
IO::BufferedFile in(fn.str());
logger.log("files", format("Reading %s", fn));
IO::BufferedFile in(fn.str());
logger.log("files", format("Reading %s", fn));
// 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");
- const PackageList &requires = main_pkg->get_required_packages();
- for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i)
+ const Package::Requirements &requires = main_pkg->get_required_packages();
+ for(Package::Requirements::const_iterator i=requires.begin(); i!=requires.end(); ++i)