我应该如何从 Makefile.am 运行预构建的 Makefile?

发布于 2024-08-08 10:12:38 字数 260 浏览 3 评论 0原文

我应该如何从 Makefile.am 运行预构建的 Makefile?

我是 automake/autoconf 构建系统的新手。我正在实现自动工具的包有几个库和每个库的测试可执行文件。有些库是自动生成的 ASN1C 代码,附带预构建的 makefile。我不确定在 Makefile.am 中“使用预构建的 makefile 构建 ASN1C 库”的最佳方式。

由于 makefile 文档丰富,尝试用这样的东西搜索 google 有点困难。

谢谢, 陈兹

How should I run a prebuilt Makefile from a Makefile.am?

I am new to automake/autoconf build system. The package I am implementing autotools for has a couple libraries and test executables for each. Some of the libraries are auto-generated ASN1C code that come with prebuilt makefiles. I am not sure of the best way to say inside of the Makefile.am "Build the ASN1C library with the prebuilt makefile".

Attempting to search google with something like this is a bit tough because of the abundance of makefile documentation.

Thanks,
Chenz

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

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

发布评论

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

评论(2

稳稳的幸福 2024-08-15 10:12:38

这对于完整构建来说相对容易,但对于增量构建来说则困难得多。

库是否支持树外构建也很重要。

要记住的重要一点是 automake 文件可以包含 make 规则,因此您可以创建一组规则来构建库,然后在构建所需的位置添加/复制该构建的输出。

为库构建分配一个目录。编写 make 规则来包装库构建过程。将库构建的输出绑定为构建的依赖项。

我们唯一没有做的就是使用默认的 automake 规则进行分发/安装 - 我不确定如何将库添加到这些列表中,但我认为有一种方法,因为您必须能够随机分发文件,例如您的发行版中的翻译。

增量构建要困难得多,因为您必须在您的 make 规则中捕获适当的依赖项,以覆盖库 makefile 中的依赖项。

This is relatively easy for full builds, but much harder for incremental builds.

It also matters whether the library supports out-of-tree builds.

The important thing to remember is that automake files can contain make rules, so you can create a set of rules to build the library, then add/copy the output of that build where you need it for your build.

Assign a directory for the library build. Write make rules to wrap the library build process. Tie in the output of the library build as dependencies of your build.

The only bit we haven't done is using the default automake rules for distribution/installation - I'm not sure how you would add the libraries to those lists, but I assume there is a way, as you must be able to distribution random files like translations in your distribution.

Incremental builds are much harder, because you have to capture appropriate dependencies in your make rules, to cover the dependencies from the library makefile.

油饼 2024-08-15 10:12:38

Automake 手册中有关于此的部分

The Automake manual has a section about this.

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