来自哪儿呢CXX的makefile中的价值? [英] Where does the value of CXX in a makefile come from?

查看:110
本文介绍了来自哪儿呢CXX的makefile中的价值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

code段:

target_test : test.cc 
    $(CXX) $(CPPFLAGS) $(CFLAGS) test.cc

我知道 CXX 是一个变量(包含编译命令调用),但我想知道,这个变量从何而来。变量未在Makefile中定义,而不是一个环境变量。谁能解释其中 CXX 的价值从何而来?

I know that CXX is a variable (containing the compiler command to call), but I was wondering where this variable comes from. The variable is not defined in the makefile and is not an environment variable. Can anyone explain where the value of CXX comes from?

推荐答案

请有几个 predefined变量的是 CC之间。最初,它被设置为 CC 这是一个符号链接到已安装的C编译器:

Make has several predefined variables among which is CC. Initially, it is set at cc which is a symlink to the installed C compiler:

$ readlink -f `which cc`
/usr/bin/gcc-4.6

还有:

$ readlink -f `which c++`
/usr/bin/g++-4.6

如果你想你可以改变它。

You can change it if you want.

您可以使用使-p -f /开发/空来获取所有隐含规则和变量列表。我不能显示输出,因为现在我有一个非标准的安装和输出不是英文。

You can use make -p -f /dev/null to get a list of all implicit rules and variables. I cannot show the output right now because I have a non-standard install and the output is not in English.

这篇关于来自哪儿呢CXX的makefile中的价值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆