Generate multiple target using single action/rule

白昼怎懂夜的黑 提交于 2020-01-01 01:52:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!