CFLAGS

C语言编译器参数。
CFLAGS and CXXFLAGS are either the name of environment variables or of Makefile 
variables that can be set to specify additional switches to be passed to a compi
ler in the process of building computer software.

These variables are usually set inside a Makefile and are then appended to the
 command line when the compiler is invoked. If they are not specified in the 
 Makefile, then they will be read from the environment, if present. Tools like a
 utoconf's ./configure script will usually pick them up from the environment and 
 write them into the generated Makefiles. 
CFLAGS allows to add switches for the C compiler, while CXXFLAGS is meant to be
 used when invoking a C++ compiler. Similarly, a variable CPPFLAGS 
 exists with switches to be passed to the C preprocessor. 
These variables are most commonly used to specify optimization or debugging 
switches to a compiler, as for example -g, -O2 or (GCC-specific) -march=athlon.

因此,如果我们在环境变量中设置了“CFLAGS”环境变量,那么我们就可以在所有的Makefi
le中使用这个变量了。这对于我们使用统一的编译参数有比较大的好处。如果Makefile中定
义了CFLAGS,那么则会使用Makefile中的这个变量,如果没有定义则使用系统环境变量的值
,一个共性和个性的统一,很像“全局变量”和“局部变量”的特性。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值