简体   繁体   English

如何使用特定的gcc编译器运行make命令?

[英]How can I run make command by using specific gcc compiler?

I have to run make command using specific version gcc compiler (using gcc-4.1 because after that versions will give deprecated method warnings or errors).. Now, there are several versions of gcc installed in the server. 我必须使用特定版本的gcc编译器(使用gcc-4.1来运行make命令),因为在此之后,该版本将给出不建议使用的方法警告或错误)。现在,服务器中安装了多个版本的gcc。 Can anybody help, how can I run it (make command) to a specific version gcc compiler (means on gcc-4.1). 谁能帮忙,如何将其(make命令)运行到特定版本的gcc编译器(意味着gcc-4.1)。

You can do: 你可以做:

CC=gcc-4.1 make

That will fill the $(CC) variable of your make. 这将填充您的make的$(CC)变量。 Also, you can write: 另外,您可以编写:

make CC=gcc-4.1

如果您的makefile没有重置编译器,并且您的规则没有对编译器进行硬编码,则可以使用CC和CXX环境变​​量来控制将使用的编译器。

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

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