我如何查看GNU make运行的命令? [英] How do I see the commands that are run by GNU make?
问题描述
我正在尝试调试复杂的Makefile.您如何获得GNU make来打印它运行的所有命令?我无法在man
页中找到答案(使用-d标志似乎无法打印出来).
I'm trying to debug a complex Makefile. How do you get GNU make to print all the commands it runs? I couldn't find the answer in the man
page (using the -d flag doesn't seem to print it).
(这不是回答我的问题的必要信息,但是如果您想知道:我在编译基于NVIDIA CUDA库构建的项目时遇到了麻烦.我可以自己编译它,但是使用它们的Makefile结果会讨厌的编译器错误.我想使用它们提供的Makefile来简化打包,并包含它们已经链接的其他软件包.)
(This isn't necessary information to answer my question, but in case you're wondering: I'm having trouble compiling a project built on NVIDIA's CUDA library. I can compile it myself, but using their Makefile results in a nasty compiler error. I'd like to use their provided Makefile for easier packaging, and inclusion of other packages that they link in already.)
推荐答案
-n
触发空运行" ,尽管将执行的命令已打印,但其中没有命令执行.
-n
triggers a "dry run" in which no command is executed, though the commands which would execute are printed.
但是,如果您的Makefile是递归的,那将无济于事.
If your Makefile is recursive, though, this won't help much.
这篇关于我如何查看GNU make运行的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!