master
Daniel Kolesa 2015-11-05 18:43:58 +00:00
parent ed8b0a428e
commit d1bb66976e
1 changed files with 14 additions and 16 deletions

30
main.cc
View File

@ -178,22 +178,21 @@ struct ObState {
int exec_list(const Vector<SubRule> &rlist, Vector<String> &subdeps, int exec_list(const Vector<SubRule> &rlist, Vector<String> &subdeps,
ConstCharRange tname) { ConstCharRange tname) {
String repd; String repd;
for (auto &sr: rlist.iter()) for (auto &sr: rlist.iter()) for (auto &target: sr.rule->deps.iter()) {
for (auto &target: sr.rule->deps.iter()) { ConstCharRange atgt = target.iter();
ConstCharRange atgt = target.iter(); repd.clear();
repd.clear(); auto lp = ostd::find(atgt, '%');
auto lp = ostd::find(atgt, '%'); if (!lp.empty()) {
if (!lp.empty()) { repd.append(slice_until(atgt, lp));
repd.append(slice_until(atgt, lp)); repd.append(sr.sub);
repd.append(sr.sub); lp.pop_front();
lp.pop_front(); if (!lp.empty()) repd.append(lp);
if (!lp.empty()) repd.append(lp); atgt = repd.iter();
atgt = repd.iter();
}
subdeps.push(atgt);
int r = exec_rule(atgt, tname);
if (r) return r;
} }
subdeps.push(atgt);
int r = exec_rule(atgt, tname);
if (r) return r;
}
return 0; return 0;
} }
@ -399,7 +398,6 @@ int main(int argc, char **argv) {
break; break;
default: default:
return ob_print_help(argv[0], ostd::err, 1); return ob_print_help(argv[0], ostd::err, 1);
break;
} }
} }