[Scons-dev] Builder issue

Neven Klacar nklacar at gmail.com
Tue Nov 26 15:17:17 EST 2013

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


In the builder I created a an emitter which modifies the target files to
have a different name.
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:


return (target,source)

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

.../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!


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/scons-dev/attachments/20131126/034dad24/attachment.htm>

More information about the Scons-dev mailing list