如何查找Makefile中错误的行号?
我正在运行以下命令:
make -f makefile.gcc
输出为:
make: -c: 未找到命令
如何找出导致错误的行? makefile 有数百行长,否则无法弄清楚它。
我尝试了 -d
开关,但没有打印任何有用的信息。
I am running the following command:
make -f makefile.gcc
And the output is:
make: -c: Command not found
How can I find out which line is causing the error? The makefile is hundreds of lines long and there's no way of figuring it out otherwise.
I tried the -d
switch, but that didn't print any useful information.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在 make 命令上运行 strace,这可能会帮助您找到问题所在。然后您可以在 makefile 中搜索它。
这是有关 strace 的帖子的链接:
http://linuxhelp.blogspot.com/2006/05/strace -非常强大的故障排除.html
This might help you locate what goes wrong if you do run strace on the make command. Then you can search the makefile for that afterwards.
Here's a link to a post about strace:
http://linuxhelp.blogspot.com/2006/05/strace-very-powerful-troubleshooting.html
问题似乎在于 makefile 中包含带有“\”的路径,并且由于我在 Linux 上运行,这将是一个问题。
我仍在致力于解决该问题。
It seems like the problem is that the makefile contain paths with '\' in them and since I'm running on Linux, that's going to be a problem.
I'm still working on a solution for that.