[英]how to add a flag in any make file
I have a program and I want to measure it performance but using gprof.now I want to add a -pg
flag in it. 我有一个程序,我想测量它的性能,但是现在使用gprof.now,我想在其中添加-pg
标志。 I have many different files makefile.am makefile.in configure 我有许多不同的文件makefile.am makefile.in配置
I install the program using following steps 我使用以下步骤安装程序
./configure
make
make install
Now I have read somewhere that: 现在我在某处读到了:
I am totally confused and want to ask two question 我很困惑,想问两个问题
-pg
flag? 在哪个文件中以及-pg
标志在哪里添加? In makefile.in or makefile.am as they both have different types of flag options? 在makefile.in或makefile.am中,因为它们都有不同类型的标志选项? man gcc: 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.
It says it needs to be in CPPFLAGS
(used for both C and C++ code) and LDFLAGS
(unless non-standard variables are used). 它说它必须使用CPPFLAGS
(用于C和C ++代码)和LDFLAGS
(除非使用非标准变量)。 The standard way is to pass flags to configure
script: 标准方法是传递标志以configure
脚本:
$ ./configure CPPFLAGS=-pg LDFLAGS=-pg
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.