rule- for dep-less rule definitions
parent
371e8597f4
commit
2a84040028
|
@ -24,7 +24,7 @@ rule %.o %.c [
|
||||||
shell $CC -c -o $target $source
|
shell $CC -c -o $target $source
|
||||||
]
|
]
|
||||||
|
|
||||||
rule clean [] [
|
rule- clean [
|
||||||
echo " CLEAN" $OBJ test
|
echo " CLEAN" $OBJ test
|
||||||
shell rm -f $OBJ test
|
shell rm -f $OBJ test
|
||||||
]
|
]
|
||||||
|
|
13
main.cc
13
main.cc
|
@ -394,6 +394,19 @@ int main(int argc, char **argv) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
os.cs.add_command("rule-", "seN", [](cscript::CsState &, const char *tgt,
|
||||||
|
ostd::Uint32 *body, int *numargs) {
|
||||||
|
auto targets = cscript::util::list_explode(tgt);
|
||||||
|
for (auto &target: targets.iter()) {
|
||||||
|
Rule &r = rules.push();
|
||||||
|
r.target = target;
|
||||||
|
if (*numargs > 1) {
|
||||||
|
r.func = body;
|
||||||
|
cscript::bcode_ref(body);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
os.cs.add_command("getenv", "s", [](cscript::CsState &cs,
|
os.cs.add_command("getenv", "s", [](cscript::CsState &cs,
|
||||||
const char *en) {
|
const char *en) {
|
||||||
if (ignore_env) {
|
if (ignore_env) {
|
||||||
|
|
Loading…
Reference in New Issue