[Scons-users] Problem with custom builder
Michael Pock
mhp77 at gmx.at
Tue Jul 30 15:19:05 EDT 2013
Hi Dirk,
On 29/07/13 22:13, Dirk Bächle wrote:
> Hi Michael,
>
> On 29.07.2013 08:01, Michael Pock wrote:
>> [...] 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.
>
> 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).
>
> Best regards,
>
> Dirk
a pseudo-builder that loops over the directory list seems to be the
way to go. Thanks!
Best regards,
Michael
More information about the Scons-users
mailing list