I need some extra files (p.ex. memory mapping) from the linker thus I've modified the flags accordingly:
How could I get these additional
.map files cleaned up with
I know there are
Emitters to add targets. Is it possible to extend a buildin builder of
What is an appropriate way?
Ok, I found a way to do it. Scons provides a variable
PROGEMITTER which is documented as 'TODO'.
def prog_emitter(target, source, env): # assume target is a list! # exchange extension of target file with .map target.append(os.path.splitext(target.get_path()) + '.map') return target, source myenv.Append(PROGEMITTER=prog_emitter)
For other builders you could use
add_emitter. You'll find all loaded builders in
If you know what the name of the file is going to be, then you list it as a side effect and set it to be cleaned.
myenv.Append(LINKFLAGS=...) lib = myenv.SharedLibrary(source) map = SideEffect('file.map', lib) Clean(lib, map)