【问题标题】:About a deep header file in Makefile关于 Makefile 中的深层头文件
【发布时间】:2013-01-11 07:09:36
【问题描述】:

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

【问题讨论】:

    标签: makefile


    【解决方案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.

    另见Generating Prerequisites Automatically

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-17
      • 1970-01-01
      相关资源
      最近更新 更多