Description
This issue was originally created at: 2010-06-21 13:50:43.
This issue was reported by: gregnoel
.
gregnoel said at 2010-06-21 13:50:43
There's a persistent request that turns up on the mailing list for a feature >similar to Make's suffix transformation:
.tgt : .src
command ...
This says, "If I need a file with a suffix of .tgt and I have a file of .src, apply the command(s) on the latter file to create the former."
For SCons, the equivalent would be, "If I have a file with a suffix of .src, here's how to convert it into a file with a suffix of .tgt."
I propose a new function, SuffixBuilder (horrible name, someone please suggest a better one), to provide this functionality:
SuffixBuilder('.tgt', '.src', action)
Instead of the current scheme of builders needing to poll a fixed set of known sources (or making special arrangements to have an extensible list), a builder would ask for the list of builders to apply:
get_build_list('.tgt', 'file.src
which would return the list of actions needed. (Actually, it should return None if there is no path, a list of the steps needed if there is only one path, or a tuple of lists if there are multiple paths.)
Existing builders would have to be extended to register themselves, which would be a lot of detail work. And there are some details about batch builders (combine inputs to produce multiple outputs) and multiple builders (one input
producing more than one output) that will need to be worked out.
Note that Make also has a type of rule that's a generalization. I'm going to get the syntax wrong, but it allows for more complex relationships:
foo_%_bar.tgt : foo_% %_bar.src
command ...
This says that to build foo_XXX_bar.tgt you need both foo_XXX and XXX_bar.src to be present before applying the command(s). I am specifically NOT proposing to implement this rule (initially?), although I think the permitted suffixes should allow something that is not just a dot followed by letters.
For example, this this should be supported:
SuffixBuilder('.sh', '_sh.in', action)
or even:
SuffixBuilder('.sh', '_sh', action)
gregnoel said at 2010-07-16 06:50:14
Bug party triage. Greg to draft a SEP and review it next bug party.
gregnoel said at 2010-08-08 12:47:20
Bug party triage.