main func cleanup

master
Daniel Kolesa 2015-10-21 21:09:21 +01:00
parent d5ec6eea73
commit e758d6e3d8
1 changed files with 6 additions and 6 deletions

12
main.cc
View File

@ -318,6 +318,11 @@ struct ObState {
return exec_func(target, rlist);
}
int exec_main(ConstCharRange target) {
RuleCounter cnt(counters);
return cnt.wait_result(counters, exec_rule(target));
}
void rule_add(const char *tgt, const char *dep, ostd::Uint32 *body) {
auto targets = cscript::util::list_explode(tgt);
auto deps = dep ? cscript::util::list_explode(dep)
@ -447,10 +452,5 @@ int main(int argc, char **argv) {
if (os.rules.empty())
return os.error(1, "no targets");
ObState::RuleCounter maincnt(os.counters);
int ret = os.exec_rule((optind < argc) ? argv[optind] : "all");
ret = maincnt.wait_result(os.counters, ret);
if (ret)
return ret;
return 0;
return os.exec_main((optind < argc) ? argv[optind] : "all");
}