We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
到目前为止,我找到的关于 makefile 的最佳教程是这个。 您的其他选择之一是学习自动工具并让它们为您生成 makefile,尽管有点过时 这个是我发现最好学习的教程。
The best tutorial that I have found for makefiles so far has been this one. One of your other options is to learn autotools and let them produce your makefiles for you, though a little outdated this is the tutorial that I found best to learn from.
您还可以使用此示例教程。 它提供了非常简单的示例,适用于简单的项目。
You could also use this tutorial by example. It provides very easy examples that will work for simple projects.
这就是您所需要的: make
This is all you need: make
虽然学习如何读写 Makefile 是件好事,但我强烈建议您使用 CMake 用于您的 C/C++ 构建,而不是编写您自己的 Makefile。 制作可移植的 Makefile 非常困难,这就是为什么 C++ 社区从手工制作的 Makefile 转向使用 GNU Autotools(Automake、Autoconf、Autoheader、Autoreconf、Libtool 等)。然而,GNU 的极端复杂性Autotools 还有很多不足之处,导致 CMake 的创建,它很快成为首选的构建工具适用于 C/C++ 社区。 它已经被越来越多的项目采用,包括 KDE。
While it is well and good that you learn how to read and write a Makefile, I strongly recommend that you use CMake for your C/C++ builds instead of writing your own Makefile. It is very difficult to craft a portable Makefile, which is why the C++ community shifted from hand-crafted makefiles to using the GNU Autotools (Automake, Autoconf, Autoheader, Autoreconf, Libtool, etc.).However, the extreme complexity of the GNU Autotools left much to be desired, resulting in the creation of CMake, which is quickly becoming the build tool of choice for the C/C++ community. It has already been adopted by a growing list of projects, including KDE.