繁体   English   中英

如何在任何make文件中添加标志

[英]how to add a flag in any make file

我有一个程序,我想测量它的性能,但是现在使用gprof.now,我想在其中添加-pg标志。 我有许多不同的文件makefile.am makefile.in配置

我使用以下步骤安装程序

./configure
make
make install

现在我在某处读到了:

  • automake从Makefile.am继承Makefile.in
  • 配置从Makefile.in生成Makefile

我很困惑,想问两个问题

  1. 在哪个文件中以及-pg标志在哪里添加? 在makefile.in或makefile.am中,因为它们都有不同类型的标志选项?
  2. 如果configure从makefile.in生成makefile,而automake从makefile.am生成makefile.in,那么我们应该在./configure之前使用make吗? 什么层次?

man gcc:

   -pg Generate extra code to write profile information suitable for the
       analysis program gprof.  You must use this option when compiling
       the source files you want data about, and you must also use it when
       linking.

它说它必须使用CPPFLAGS (用于C和C ++代码)和LDFLAGS (除非使用非标准变量)。 标准方法是传递标志以configure脚本:

$ ./configure CPPFLAGS=-pg LDFLAGS=-pg

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM