[Scons-users] Problem with custom builder

Michael Pock mhp77 at gmx.at
Mon Jul 29 02:01:51 EDT 2013


On 26/07/13 23:36, Dirk Bächle wrote:

> Hi Michael,

>

> it seems as if you're almost there.

>

> On 26.07.2013 22:52, Michael Pock wrote:

>> Hi,

>>

>> I'd like to implement a builder that takes source directories dir.a,

>> dir.b and dir.c, and pipes their contents to target files dir.a.list,

>> dir.b.list and dir.c.list. I've already tried the following:

>>

>> env = Environment()

>>

>> env["BUILDERS"]["List"] = Builder(action="ls ${SOURCE} >${TARGET}",

>> suffix="list" ,

>> source_factory=Dir ,

>> single_source=True )

>>

>> env.List(["dir.a", "dir.b", "dir.c"])

>>

>> Unfortunately, this doesn't work since the directory suffix is

>> stripped when computing the target filename. Hence, the target

>> filename is dir.list for all source directories dir.a, dir.b and dir.c.

>>

>> I hoped that passing source_suffix=None or source_suffix="" to the

>> Builder function would solve my problem. But these options seem to

>> make no difference.

>

> Please try

>

> suffix=".list"

>

> instead, and the correct name for the other parameter is "src_suffix".

> You can find some more info about this in the MAN page (section

> "Examples"/"Defining Your Own Builder Object").

>

> Does this help already?

>

> Best regards,

>

> Dirk


Hi Dirk,

thanks for your reply. I tried out your suggestions, but, unfortunately,
SCons still terminates with the error message

scons: *** Multiple ways to build the same target were specified for:
dir.list (from ['dir.a'] and from ['dir.b'])

It seems there is no way to prevent SCons from stripping source filename
suffixes when computing target filenames.

Best regards,
Michael


More information about the Scons-users mailing list