进行安装会导致重新编译

发布于 2024-09-09 03:35:09 字数 199 浏览 1 评论 0原文

我正在编写一个主 makefile 来编译和安装多个基于 autoconf 的库,这些库相互依赖。第一次运行一切顺利。问题是:如果我单独处理这些库之一并执行“make && make install”前缀文件夹中的头文件将被覆盖(即使它们未受影响)。这会导致所有依赖库从头开始编译。

有没有办法在不侵入 makefile 的情况下避免不必要的重新编译?

I am writing a master makefile to compile and install multiple autoconf based libraries, which depend on each other. All works well for the first go. The issue is: if I am working on one of these libraries individually and do "make && make install" header files in the prefix folder are overwritten (even if they are untouched). This causes all dependent libraries to compile from scratch.

Is there a way to avoid the unnecessary recompiles without hacking into the makefiles?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

り繁华旳梦境 2024-09-16 03:35:09

也许解决方案有点晚了,但

./configure INSTALL="install -p"

修复了重新编译问题。该标志使 GNU install 将已安装文件的时间戳设置为构建文件的时间戳。

Maybe the solution is a little late, but

./configure INSTALL="install -p"

fixes the recompilation problem. This flag makes GNU install set the timestamps of the installed files to the timestamps of the built files.

爱殇璃 2024-09-16 03:35:09

您可以使用仅存在的哨兵文件来建立依赖关系图。例如。

prefix := /usr/local

.PHONY: all
all: libx-built

libx-built \
  : libx.tar.gz \
  ; tar xzvf $@ \
  && cd libx \
  && ./configure --prefix=$(prefix) \
  && make && make install \
  && touch $@

然后,仅当 libx-built 是新的时,您才需要进行依赖 liby 构建。

liby-built \
  : liby.tar.gz libx-built \
  ; ...

You could use sentinel files that exist only to establish your dependency graph. For eg.

prefix := /usr/local

.PHONY: all
all: libx-built

libx-built \
  : libx.tar.gz \
  ; tar xzvf $@ \
  && cd libx \
  && ./configure --prefix=$(prefix) \
  && make && make install \
  && touch $@

Then, you'd make a dependent liby build only when libx-built is new.

liby-built \
  : liby.tar.gz libx-built \
  ; ...
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文