[Scons-users] How to correctly use emitters
William Blevins
wblevins001 at gmail.com
Tue Oct 25 11:57:13 EDT 2016
Pierre-Luc,
Here are some references:
User Guide on Emitter: http://www.scons.org/doc/HTML/scons-user/ch18s06.html
Wiki for custom builders: https://bitbucket.org/scons/
scons/wiki/ToolsForFools
You may have pasted the same tree twice. They look the same at a glance.
1. It should only depend on the original properties of the actual parameter
"target". I assume the return is different, so you get different results ;)
2. The only difference would result from the difference of target between
methods 1 and 2. They must not yield the same result.
3. All emitted targets should be Clean targets by default. Please read the
tools for fools. It will set you straight :)
4. Unless you have special targets such as side-effects, I would expect all
targets to be Clean targets by default.
V/R,
William
On Tue, Oct 25, 2016 at 11:29 AM, Pierre-Luc Boily <
pierreluc.boily at gmail.com> wrote:
> Hello,
>
> I am having trouble understand emitters.
>
> I have this emitter here <http://pastebin.com/Y7H6LPe0> being call from
> a
> builder in my sconscript here <http://pastebin.com/M3JT3Rga> . As you
> can
> see, I use the target and append to it new targets. This lead to a weird
> behavior. If you check my tree here <http://pastebin.com/vnZBMHx6> ,
> there is a target call /command/, but this target does not exist! It looks
> like coming from a file name from source that I specified in sconscript,
> /commands.grammar/
>
> If I changed the emitter to have something like this instead :
> /def _emit_build_grammar(target, source, env):
> files = [
> env['ENV']['LOCALROOT'] + '/sr/sra/src/grammars/' +
> env['ENV']['LANGUAGE'] + '/' + env['ENV']['GRAMMAR_NAME'] +
> '/faa.autopron',
> env['ENV']['LOCALROOT'] + '/sr/sra/src/grammars/' +
> env['ENV']['LANGUAGE'] + '/' + env['ENV']['GRAMMAR_NAME'] + '/faa.missing',
> env['ENV']['LOCALROOT'] + '/sr/sra/src/grammars/' +
> env['ENV']['LANGUAGE'] + '/' + env['ENV']['GRAMMAR_NAME'] +
> '/faa.functions']
> return files, source/
>
> then, my tree looks better <http://pastebin.com/U2iTtWXf> ! (Still have
> a
> /command /folder, but not as target anymore)
>
> So, question :
> 1 - When, for my emitter, should I append to target new targets and when
> should I override?
> 2 - Why when I append, I have this weird behavior where I have a target
> named /command/?
> 3 - I have a lot of binaries files generated by this builder and lot of
> files copied. Should I use emitter or Clean to get them removed?
> 4 - And actually, when should I use emitter vs Clean? in my example above,
> those file are generated by a perl script. I feel that have them removed
> by
> Clean should be good enough.
>
> Thank you for your patience!
>
> Pierre-Luc
>
>
>
> --
> View this message in context: http://scons.1086193.n5.
> nabble.com/How-to-correctly-use-emitters-tp40675.html
> Sent from the Users mailing list archive at Nabble.com.
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20161025/38b691fc/attachment.html>
More information about the Scons-users
mailing list