[Scons-users] creating custom builder

Ringo De Smet ringo.desmet at gmail.com
Thu Nov 8 08:22:30 EST 2012


Hello Wiktor,

First of all, I suggest you study some of the contributed custom builders
found on the wiki (source included):
http://scons.org/wiki/CustomBuilders

This should definitely help you further.

On 8 November 2012 12:43, wiktor tomczak <wiktor.tomczak at gmail.com> wrote:


> 1. I'd like the builder to always produce a fixed set of files, eg. given

> a source file foo, it should always produce target files foo_bar and

> foo_baz. Ideally, these targets would be implicit, they wouldn't need to be

> listed explicitly in targets (same way Program('hello.c') implicitly

> produces hello). How can I do that?

>


You use an emitter for that. Read in the man page under "Builder Objects"
the section about emitter:
http://scons.org/doc/production/HTML/scons-man.html#lbAP



> 2. I'd like the builder to take custom keyword arguments other than source

> and target. Can I define the builder as a Python class that implements some

> interface? Is there a Builder interface?

>


Have a look at the AutoConfigBuilder or MakeBuilder in the list of
contributed Custom Builders. These builders accept additional keyword
arguments.



> 3. Per 1., I'd like the builder to produce a set heterogeneous files which

> together form a single logical target. The builder could return a list of

> Node objects, but that would lack structure. Can I encapsulate the list in

> a custom class that represents the logical target and use that as builder's

> return value?

>


Make an Alias for the list of targets. See Alias() under "Methods and
Functions to do things"
http://scons.org/doc/production/HTML/scons-man.html#lbAI

Hope this helps,

Ringo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20121108/dfbff862/attachment.html>


More information about the Scons-users mailing list