重新编译像 mozilla 这样的庞大软件堆栈
1000 行代码中的一个小变化都会导致在整个软件上再次运行 ./configure。
有没有其他选择,我们可以只编译更改的文件和与其关联的文件?
A small change in a 1000's of lines of code leads to running the ./configure again on the entire software.
Is there any alternative, where we can compile only the changed file and the files associated with it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您有一个健全的
Makefile.am
且具有适当的依赖项,则运行./configure
和make
应该只会重新编译依赖于所触及文件的文件。所以make
已经满足了您的要求。如果您的 Makefile 不健全(例如,它们仅在您运行
make clean
时才起作用)并且您正在编译 C 或 C++ 源代码,请使用 ccache 可能会给您带来速度提升。使用 ccache 仅运行预处理器部分,并将其输出与编译输出的缓存进行比较。如果文件或其包含内容没有任何更改,则不会重新编译。正确安装后,它会以透明的方式运行。If you have a sane
Makefile.am
with proper dependencies, running./configure
andmake
should only recompile files that depend on the touched file. Somake
already does what you are asking for.If your Makefiles are not sane (e.g. they only work if you run
make clean
) and you are compiling C or C++ sources, using ccache might give you a speed gain. With ccache only the preprocessor part is run and its output compared to a cache of compile outputs. If nothing changed in the file or its includes it won't be recompiled. Properly installed it is run in a transparent way.