[Scons-users] Problem with custom builder

Michael Pock mhp77 at gmx.at
Tue Jul 30 15:25:20 EDT 2013

Hi Bill,

On 29/07/13 23:10, William Deegan wrote:

> Michael,



> On Jul 29, 2013, at 1:13 PM, Dirk Bächle <tshortik at gmx.de> wrote:


>> Hi Michael,

>> [...]

>> I had a second look at your Builder and the following code works fine on my side:


>> env = Environment()


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

>> suffix=".list",

>> source_factory=Dir,

>> single_source=True)


>> env.List("dir.a.list", "dir.a")

>> env.List("dir.b.list", "dir.b")

>> env.List("dir.c.list", "dir.c")


>> The basic problem in your case is, that the suffix of the source file changes. Usually, you'd have a single suffix, like ".dvi", that would get mapped to a suffix ".pdf" for the target.

>> When simply specifying "env.List(['dir.a'])" SCons is confused and assumes that the ".a" is the target suffix already.

>> If specifying the full target name explicitly is too cumbersome for your taste, you might want to wrap your List() in a pseudo-Builder (see chap. 20 in the UserGuide).


> Note that changes to dir.a (the source dir) (Or any files in its subdirectories) may not trigger the builder being rerun.

> Especially file additions.


> -Bill

thanks for the hint. I've already noticed that AlwaysBuild is my friend
when the source includes directories.

Best regards,

More information about the Scons-users mailing list