0

假设我有一个包含在许多源文件中的头文件,可能具有非常深的层次结构。在每个源对象的先决条件中列出这个通用头文件很无聊,不确定是否有优雅的解决方案。谢谢!

4

1 回答 1

1

您可以使用gcc -M. 来自TFM

-M Instead of outputting the result of preprocessing, output a rule suitable for make describing the dependencies of the main source file. The preprocessor outputs one make rule containing the object file name for that source file, a colon, and the names of all the included files, including those coming from -include or -imacros command line options.

另请参阅自动生成先决条件

于 2013-01-10T23:09:36.230 回答