如何从源代码正确构建 FreeBSD?

发布于 2025-01-17 06:20:54 字数 433 浏览 2 评论 0原文

我正在尝试从源代码构建 FreeBSD 以了解它是如何工作的。我用谷歌搜索了如何做到这一点,大多数解释如何构建世界的网站告诉我在源代码的目录中运行此命令:

sudo make -j1 buildworld KERNCONF=MODEDKERNEL -DNO_CLEAN

出于某种原因,我不断收到此错误...

make: invalid option -- 'D'
make: invalid option -- 'N'

任何人都知道如何解决此问题? Makefile 可以在此处找到

I am trying to build FreeBSD from source to see how it works. I googled how to do it, and most of the websites explaining how to build the world tell me to run this command inside the directory of the source code:

sudo make -j1 buildworld KERNCONF=MODEDKERNEL -DNO_CLEAN

For some reason, I keep getting this error...

make: invalid option -- 'D'
make: invalid option -- 'N'

Anyone know how to fix this? The Makefile can be found here

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

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

发布评论

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

评论(1

绅刃 2025-01-24 06:20:54

我们不需要查看 makefile,因为这个错误是由 make 由于无效的命令行参数而打印的,这意味着它在失败之前根本不会打开 makefile。

原因是 -D 等对于 GNU make 来说不是有效的命令行选项。如果您运行 man make (或在线查找 GNU make 手册),您将看到 -D 未列为有效选项。

我怀疑,当您正在阅读的网站建议您运行 make 时,它们意味着您应该运行 FreeBSD make,它确实支持 -D 选项:https://www.freebsd.org/cgi/man.cgi?make(1)< /a>

您正在尝试使用以下命令运行此命令GNU make,没有这个选项。

We don't need to see the makefile, because this error is being printed by make due to an invalid command line argument which means it's never even opening the makefile before it fails.

The reason is that -D, etc. are not valid command line options to GNU make. If you run man make (or look online for the GNU make manual) you'll see that -D is not listed as a valid option.

My suspicion is that when the websites you are reading are suggesting that you run make, they mean you should run FreeBSD make, which does support a -D option: https://www.freebsd.org/cgi/man.cgi?make(1)

You are trying to run this using GNU make, which does not have that option.

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