source.extend(generated_source)
target.append(name + '.c')
return target, source

def my_action(env, target, source):
    for t, s in zip(target, source[1:]):
        with open(t.abspath, 'w') as tf:
            with open(s.abspath, 'r') as sf:
                tf.write(sf.read())
SourcesGenerator = env.Builder(action=my_action, emitter=my_emitter)
generated_sources = SourcesGenerator(env, source='source.txt')
lib = env.Library('functions', generated_sources)
SCons to generate variable number of targets