使用并行 make 立即停止编译
有没有办法让 GNU make 的并行调用(即 make -jN)在遇到错误时立即停止所有编译?
目前我看到一条“正在等待未完成的作业”消息&然后在现有制作流程完成的同时输出多行。
Is there any way to make parallel invocations of GNU make (ie. make -jN) cease ALL compilation immediately whenever it encounters an error?
Currently I see a "Waiting for unfinished jobs" message & then many lines of output whilst existing make processes finish.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现这是一个旧线程,但答案并不明确。这对我来说一直很有效:
虽然很残酷,但确实有效。
I see this is an old thread, but the answer isn't definitive. This has always worked well for me:
It's pretty brutal, but it does the job.
没有办法做到这一点(在 GNU make 中)。唯一可能的方法是向所有配方添加一个样板节,这样如果它们失败,您将捕获失败并使用killall或类似的东西来杀死所有make实例。肯定是棘手且危险的。
当然,您始终可以自己按 CTRL-C 来停止 make。
There is no way to do this (in GNU make). The only possible way would be to add a boilerplate stanza to all of your recipes such that if they failed, you would catch the failure and use killall or something similar to kill all instances of make. Tricky and dangerous for sure.
Of course you can always hit CTRL-C yourself to stop make.