【问题标题】:How to dump aggregated output of a makefile?如何转储生成文件的聚合输出?
【发布时间】:2012-03-14 18:18:21
【问题描述】:

我正在做一个项目。 makefile 非常复杂,因为它包含多个其他 makefile,其中还包含其他更多的 makefile。我想将所有包含的 makefile 转储到一个文件中。我怎样才能做到这一点?有没有类似 C 预处理转储的东西,比如'-E'?

【问题讨论】:

    标签: makefile


    【解决方案1】:
    make -p     # GNU Make
    nmake -p    # Microsoft Make
    make -h     # help
    make -d     # debug
    make -n     # just print
    

    从一个简单的例子开始,然后从那里开始工作。当您对 Make 一无所知时,从一个大的 Makefile 开始并不是一个好主意。

    【讨论】:

    • 我很了解make,我需要弄清楚这个由其他人创建的makefile。我需要改进它并找出所有依赖项。
    【解决方案2】:

    你可以试试make --dry-run:

    `-n'
    `--just-print'
    `--dry-run'
    `--recon'
    "No-op". The activity is to print what commands would 
             be used to make the targets up to date, but 
             not actually execute them.
    

    【讨论】:

    • 基本上,我想弄清楚所有makefile的依赖关系。我正在为 gcc 寻找类似“-E”的选项。
    • make -p 就是它。见 Lumi 的回答。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-01
    • 2016-08-30
    • 1970-01-01
    相关资源
    最近更新 更多