[Scons-users] Builder

Bill Deegan bill at baddogconsulting.com
Tue Nov 26 23:13:58 EST 2013


Neven,

As Dirk mentioned in the email on the dev list the .name parameter should
not be used for this (or in general for anything.. I've never used it and
I've been using SCons a long time).

What happens if your run : scons --tree=prune ?

-Bill


On Tue, Nov 26, 2013 at 6:56 PM, Neven Klacar <nklacar at gmail.com> wrote:


> Hi, trying to make a builder that takes source file

> a.c and creates a new C file, a_altered.c using a python script or program

> that in this example will be preprocess lets say.

>

> Then I want to pass the altered file to be built in normal workflow

>

> newfile=MyBuilder("a.c")

> object=env.Object(newFile)

> env.Library(object)

> ....

>

> In the builder I created a an emitter which modifies the target files to

> have a different name.

> *Builder*

> def generate(env):

> my_bld = env.Builder(action = 'preprocess< $SOURCE > $TARGET'

> ,

> source_scanner = SCons.Scanner.C.CScanner(),

> emitter = my_emitter,

> suffix = '.c2', src_suffix = '.c')

>

> env.Append(BUILDERS = {'MyBuilder' : my_bld})

>

>

>

> def my_emitter(target, source, env):

>

> for t in target:

>

> t.name=t.name[:t.name.rfind('.')]+'_altered.c'

>

> return (target,source)

>

>

>

> The basic error I get is that there seems to be two ways to build the same

> file

>

> .../project/build/objects/a_altered.c failed: Multiple ways to build the

> same target were specified for: ...project/build/objects/a_altered.c

> (from ['.../project/src/a.c'] and from ['.../project/src/a.c'])

>

>

>

> Am I going about this the right way?

>

>

> I appreciate any help or suggestions!

>

>

> Thanks,

>

> Neven

>

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/mailman/listinfo/scons-users

>

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131126/8d5b4acb/attachment.htm


More information about the Scons-users mailing list