一次对多个系统进行交叉编译

发布于 2024-12-27 05:15:50 字数 553 浏览 0 评论 0原文

问题:如何使用一个 make 文件同时编译多个不同的系统、环境和库集?


信息:

我是一名学生,因此我的大部分工作都是为了了解这些东西是如何工作的。现在我正在从头开始构建一个游戏引擎。我希望能够使其在操作系统方面跨平台,而且适用于不同的环境。我的目标环境是 32 位和 64 位(我的台式机和上网本),带有显卡和台面,以及 Linux 和 Windows。所以总的来说它应该输出 8 个二进制文件。

我对交叉编译的整个概念仍然很陌生。我想编译多个二进制文件的过程并不难。但我有点困惑的是如何让它附加正确的库? Ubuntu Linux 与 WinAPI 库、32 位库与 64 位库。等等等等。是否有可能以这种方式获得图书馆?

如果您需要我进一步澄清,我可以。谢谢。

附录:基本上我想知道如何为我可能没有的驱动程序编译标头。例如。我想编译我的上网本上的所有文件,包括openCL的文件,我不想运行它们,因为我的上网本没有GPU,我只想编译。相反,我想为我的上网本使用桌面编译,该上网本使用 ocelot 和 mesa 进行 GPU 处理,但我的桌面上没有 mesa 或 ocelot。之类的事情。谢谢。

Question: How do make a single make file to compile several different systems, environments, and sets of libraries at once?


Info:

I'm a student and as such most of my work is done for the sake of learning how these things work. Right now I'm building a game engine from the ground up. I'd like to be able to make it cross platform in terms of OS, but also for different environments. My target environments are both 32 and 64 bit (my desktop as well as my netbook), with a graphics card and with mesa, and linux and windows. so overall it should out put 8 binaries.

I'm still very new to make, as well as the whole concept of cross compiling. I imagine that the process of compiling more than 1 binary isn't hard. but where I'm kind of stuck is how do i get it to attach the right libraries? The Ubuntu Linux vs the WinAPI libraries, 32bit vs 64bit libraries. etc etc. Is it even possible to get libraries in such a manner?

If you need me to clarify further I can. Thanks.

Addendum: Basically I want to know how to compile headers for drivers i may not have. for example. I want to compile all the files on my netbook, including the ones for openCL, I don't want to run them, as my netbook has no GPU, I just want to compile. conversely, I want to use my desktop compile for my netbook which uses ocelot and mesa for its gpu dealings, but my desktop does not have mesa or ocelot on it. that sort of thing. Thanks.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文