问题
How do I write a rule to generate set of files using a single action.
Example:
Files x, y, z are generated as a result of single execution of script t.sh which takes file a as input.
x y z: a
t.sh $@
GNU make tries to execute t.sh 3 times.
回答1:
You could implement one of the solutions specified in the automake manual.
Because you've tagged this gnumake, I should also point out that using a GNU make pattern rule (the ones with %) with multiple targets WILL consider both generated from one execution of the rule: see the GNU make manual.
来源:https://stackoverflow.com/questions/3016258/generate-multiple-target-using-single-action-rule