gpt4 book ai didi

gcc - make 和 gcc 有什么区别?

转载 作者:行者123 更新时间:2023-12-01 22:23:42 31 4
gpt4 key购买 nike

article中的最后一句引起了我的注意

[F]or C/C++ developers and students interested in learning to program in C/C++ rather than users of Linux. This is because the compiling of source code is made simple in GNU/Linux by the use of the 'make' command.

我一直使用 gcc 来编译我的 C/C++ 程序,而使用 javac 来编译我的 Java 程序。我只使用 make 通过 configure/make/make install 将程序安装到我的计算机上。

看来您显然可以使用 make 命令编译所有程序。

ma​​ke 和 gcc 有什么区别?

最佳答案

嗯...gcc是一个编译器,make是一个帮助构建程序的工具。差异是巨大的。你永远不可能纯粹使用 make 来构建一个程序;它不是编译器。它引入了一个单独的“规则”文件,它描述了如何从源代码到成品程序。然后它解释这个文件,找出需要编译的内容,并为您调用 gcc。这对于具有数百或数千个源代码文件的大型项目非常有用,并且可以跟踪编译器选项、包含路径等内容。

关于gcc - make 和 gcc 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/768373/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com