python - specifying targets for a custom scon builder -
hey i've written custom builder should work differently .c files .structdoc file. here's sconstruct file
env = environment() prepare_structdoc = builder(action='python prep_structdoc.py < $source > $target', suffix='.structdoc', src_suffix='.c') prepare_postc = builder(action='python preprocess_mods.py < $source > $target', suffix='.postc', src_suffix='.structdoc') env['builders']['structdocbuilder'] = prepare_structdoc env['builders']['postcbuilder'] = prepare_postc sconscript('mods/sconscript', exports='env')
these builders work on 1 source , produce 1 target, run loop in sconscript on *.c files this
import("env") fname in glob("*.c"): struct_doc= env.structdocbuilder(source=fname) post_c = env.postcbuilder(source=struct_doc)
this trick. however, use these builders 1 file if mention . i.e. inside mods/ specify scons -u abc.c
.
ive tried using command_line_targets follows:
import("env") fname in command_line_targets or glob("*.c"): struct_doc= env.structdocbuilder(source=fname) post_c = env.postcbuilder(source=struct_doc)
scons -u mod_dummy.c output gives me is
scons: building targets ...
scons: nothing done `mods/mod_dummy.c'.
scons: done building targets.
it 1 of targets in command_line_targets isnt going inside loop reason. there must way of achieving this.
how modify code work 1 of them ?
you need specify target node, not source node on commandline.
scons -u abc.postc
Comments
Post a Comment