X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuilder.cpp;h=1c90aa8e2229ac6192fcc9bff7c92b7c59417e2a;hb=c8dfe708b5551818dad3f6cf3e86cc72fe684572;hp=2f71f1a74c2b3e8ccbd93bf235618a07cdd1ce99;hpb=69cdee2c53972c1dd7e1b9d83ddcd8f6c3c589f7;p=builder.git diff --git a/source/builder.cpp b/source/builder.cpp index 2f71f1a..1c90aa8 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -90,7 +90,6 @@ Builder::Builder(int argc, char **argv): getopt.add_option( "max-depth", max_depth, GetOpt::REQUIRED_ARG).set_help("Show up to NUM levels in analysis..", "NUM"); getopt.add_option( "prefix", prfx, GetOpt::REQUIRED_ARG).set_help("Install things to DIR.", "DIR"); getopt.add_option( "tempdir", temp_str, GetOpt::REQUIRED_ARG).set_help("Store temporary files in DIR.", "DIR"); - getopt.add_option( "warnings", cmdline_warn, GetOpt::REQUIRED_ARG).set_help("Compiler warnings to use.", "LIST"); usagemsg = getopt.generate_usage(argv[0])+" [ ...]"; helpmsg = getopt.generate_help(); getopt(argc, argv); @@ -200,17 +199,6 @@ Builder::Builder(int argc, char **argv): build_type = &i->second; } - warnings.push_back("all"); - warnings.push_back("extra"); - warnings.push_back("shadow"); - warnings.push_back("pointer-arith"); - warnings.push_back("error"); - for(StringList::iterator i=cmdline_warn.begin(); i!=cmdline_warn.end(); ++i) - { - vector warns = split(*i, ','); - warnings.insert(warnings.end(), warns.begin(), warns.end()); - } - toolchain.add_tool(new GnuCCompiler(*this, *current_arch)); toolchain.add_tool(new GnuCxxCompiler(*this, *current_arch)); toolchain.add_tool(new GnuLinker(*this, *current_arch)); @@ -343,6 +331,14 @@ void Builder::add_target(Target *t) targets.insert(TargetMap::value_type(t->get_name(), t)); } +void Builder::add_primary_target(Target &t) +{ + get_target("world")->add_dependency(t); + + if(t.get_package()==main_pkg && t.get_component() && t.get_component()->is_default()) + get_target("default")->add_dependency(t); +} + void Builder::usage(const char *reason, const char *argv0, bool brief) { if(reason) @@ -369,7 +365,7 @@ int Builder::load_build_file(const FS::Path &fn) logger.log("files", format("Reading %s", fn)); DataFile::Parser parser(in, fn.str()); - Loader loader(*this, fn.subpath(0, fn.size()-1)); + Loader loader(*this); loader.load(parser); return 0; @@ -583,9 +579,8 @@ string Builder::usagemsg; string Builder::helpmsg; -Builder::Loader::Loader(Builder &b, const FS::Path &s): - DataFile::ObjectLoader(b), - src(s) +Builder::Loader::Loader(Builder &b): + DataFile::ObjectLoader(b) { add("architecture", &Loader::architecture); add("binary_package", &Loader::binpkg); @@ -622,7 +617,7 @@ void Builder::Loader::profile(const string &) void Builder::Loader::package(const string &n) { - SourcePackage *pkg = new SourcePackage(obj, n, src); + SourcePackage *pkg = new SourcePackage(obj, n, get_source()); if(!obj.main_pkg) obj.main_pkg = pkg;