如何设置自动工具来在多个系统上同时为单独的架构构建项目?

发布于 2024-08-18 13:33:10 字数 301 浏览 4 评论 0原文

我有一个使用 automake 和 autoconf 的 C++ 项目。我对这两个都是新手。

我的主目录是网络安装的——在我们拥有的每台服务器上都是一样的——我想在不同的机器上同时编译和运行该项目(及其可执行文件)。

我们的服务器通常采用不同的架构。我的桌面是 32 位,但服务器是 64 位等。

我在 configure.acMakefile.am 中使用哪些选项来编译目标文件以机器架构命名的单独目录?在常规 Makefile 中执行此操作相对简单,但我不知道如何设置自动工具。

I've got a C++ project which uses automake and autoconf. I'm new to both of these.

My home directory is network mounted -- the same on every server we have -- and I want to compile and run the project (and its executable) concurrently on separate machines.

Our servers are frequently different architectures. My desktop is 32-bit, but the server is 64-bit, etc.

What options do I use in configure.ac and Makefile.am to compile the object files in separate directories named for the machine architectures? It's relatively simple to do this in a regular Makefile, but I don't know how to set autotools.

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

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

发布评论

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

评论(1

丑疤怪 2024-08-25 13:33:10

如果您在configure.ac和Makefile.am设置中没有做任何“错误”或异常的事情,则会自动支持:

mkdir /some/where/build
cd /some/where/build
/else/where/source/configure --options...
make
make install

基本上,您可以在任何您想要的地方创建构建目录(在您的情况下可能在非网络安装上) ,然后从那里调用配置。然后,这将在您创建的构建目录中构建代码。

If you don't do anything "wrong" or unusual in your configure.ac and Makefile.am setup, this is supported automatically:

mkdir /some/where/build
cd /some/where/build
/else/where/source/configure --options...
make
make install

Basically, you create the build directory anywhere you want (in your case probably on a non-network mount), and call configure from there. This will then build the code in the build directory you have created.

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