Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想通过一次调用将当前目录中的所有 cpp 文件编译成它们自己的可执行文件。这些文件都不共享任何内容,因此不需要将它们编译到单个程序中。我正在考虑使用脚本,但后来我想起了 make 和 makefiles(多年来没有使用它)。我可以写一个makefile来做到这一点吗?
这篇文章回答了你的问题。它是关于 C 程序的,但您可以将其改编为 C++。
Makefile 编译多个 C 程序?