make actions always execute regardless of files existing

master
Daniel Kolesa 2015-11-21 18:30:11 +00:00
parent b3bf83dfc5
commit 6867946e97
1 changed files with 34 additions and 34 deletions

68
main.cc
View File

@ -108,7 +108,7 @@ struct ObState {
Rule(): target(), deps(), func(nullptr), action(false) {}
Rule(const Rule &r): target(r.target), deps(r.deps), func(r.func),
action(false) {
action(r.action) {
cscript::bcode_ref(func);
}
~Rule() { cscript::bcode_unref(func); }
@ -200,45 +200,45 @@ struct ObState {
int ret = wait_result([&rlist, &subdeps, &tname, this]() {
return exec_list(rlist, subdeps, tname);
});
if (!ret && ob_check_exec(tname, subdeps)) {
Uint32 *func = nullptr;
for (auto &sr: rlist.iter()) {
Rule &r = *sr.rule;
if (r.func) {
func = r.func;
break;
}
Uint32 *func = nullptr;
bool act = false;
for (auto &sr: rlist.iter()) {
Rule &r = *sr.rule;
if (r.func) {
func = r.func;
act = r.action;
break;
}
if (func) {
StackedValue targetv, sourcev, sourcesv;
}
if ((!ret && (act || ob_check_exec(tname, subdeps))) && func) {
StackedValue targetv, sourcev, sourcesv;
targetv.id = cs.new_ident("target");
if (!cscript::check_alias(targetv.id))
targetv.id = cs.new_ident("target");
if (!cscript::check_alias(targetv.id))
return 1;
targetv.set_cstr(tname);
targetv.push();
if (subdeps.size() > 0) {
sourcev.id = cs.new_ident("source");
sourcesv.id = cs.new_ident("sources");
if (!cscript::check_alias(sourcev.id))
return 1;
if (!cscript::check_alias(sourcesv.id))
return 1;
targetv.set_cstr(tname);
targetv.push();
if (subdeps.size() > 0) {
sourcev.id = cs.new_ident("source");
sourcesv.id = cs.new_ident("sources");
if (!cscript::check_alias(sourcev.id))
return 1;
if (!cscript::check_alias(sourcesv.id))
return 1;
sourcev.set_cstr(subdeps[0]);
sourcev.push();
sourcev.set_cstr(subdeps[0]);
sourcev.push();
auto dsv = ostd::appender<String>();
ostd::concat(dsv, subdeps);
ostd::Size len = dsv.size();
sourcesv.set_str(ostd::CharRange(dsv.get().disown(),
len));
sourcesv.push();
}
return cs.run_int(func);
auto dsv = ostd::appender<String>();
ostd::concat(dsv, subdeps);
ostd::Size len = dsv.size();
sourcesv.set_str(ostd::CharRange(dsv.get().disown(),
len));
sourcesv.push();
}
return cs.run_int(func);
}
return ret;
}