[Scons-users] How to deal with a list of targets in a Command builder?

Carsten Fuchs carsten.fuchs at cafu.de
Mon Feb 9 16:45:34 EST 2015

Hi Dirk,

Am 09.02.2015 um 14:14 schrieb Dirk Baechle:
> You'll have to define a custom Emitter for your "CAwe" Builder, have a
> look at http://www.scons.org/wiki/ToolsForFools for a simple example.

Many thanks for your quick reply!   :-)

That page is very well written (I also love the same step-by-step style 
in the SCons User's Guide), and I (seem to) understand how Emitters work.

The problem is that Emitters apparently can only add files that are well 
known ahead of time. E.g. in ToolsForFools, for an `example.asm` target 
file, it adds `example.hex` and `example.cod` as additional targets.

My problem is that ahead of time, my target files are unknown in name 
and number. They can be described with a glob pattern like 
`#/Doxygen/scripting/tmpl/*.hpp`, but actually enumerating them is 
possible only after the program that generates them has run.

Thus, my original question was how I can bring an Emitter to deal with 
this scenario.

Good news however is that while I was reading the ToolsForFools page, I 
realized that my generated targets list is possibly not so 
unforeseeable, after all. That is, contrary to first assumption, I can 
probably come up with the proper, fixed list of *.hpp files ahead of 
time, and this would solve the problem entirely at its root.

Anyways, if there is a solution to the unknown, general case, I'd still 
like to hear more about it!

Best regards,

More information about the Scons-users mailing list