安装新模块时 dmake 实际上在做什么?

发布于 2024-08-31 10:38:16 字数 382 浏览 5 评论 0原文

经过一番努力,我刚刚成功安装了 perl/Tk 模块。我意识到我不明白 dmake 或 make 等实际上在做什么。

我正在使用安装在 C:\strawberry 的 Strawberry Perl。

首先,我将模块解压到另一个目录并运行 perl makefile.pl ,效果很好。然后我尝试了dmake,但没有成功。我想对于知道这是如何工作的人来说这将是显而易见的。

当我将模块放置为 C:\strawberry 的子目录时,我可以运行 perl makefile.pl、dmake、dmake test 和 dmake install。

我的猜测是 dmake install 正在向解释器添加一些可执行文件,并且模块必须位于子目录中才能工作。有没有任何文章详细解释它在做什么?

I just mangaged to install the perl/Tk module after much struggle. I realise I don't understand what dmake or make etc is actually doing.

I am using strawberry perl installed at C:\strawberry.

Fisrt I unpacked the module to another directory and ran perl makefile.pl which worked fine. Then I tried dmake which did not work. I guess that will be obvious to people who know how this works.

When I placed the module as a sub-directory of C:\strawberry I could run perl makefile.pl, dmake, dmake test and dmake install.

My guess is that dmake install is adding some executable files to the interpreter and to work the module must be in a subdirectory. Is there any article anywhere that explains what it is doing in detail?

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

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

发布评论

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

评论(2

一身软味 2024-09-07 10:38:16

当您看到 Makefile.PL 文件时,这意味着它是一个安装系统为 ExtUtils:: 的模块MakeMaker

EU::MM 是安装 Perl 模块的经典系统,其历史可以追溯到 CPAN 诞生之初。它依赖于这样一个事实,即程序 make(一种常见且强大的依赖项跟踪工具)几乎在每个 Unix 系统上都可用,并且依赖于各种 unixy 模式和行为。

Makefile.PL 是模块作者维护的 Perl 脚本。它从 Perl 本身读取有关系统的信息,并使用该信息创建 Makefile。此 Makefile 指示 make 要执行的操作。有关 make 的更多信息,请查看有关 Make 的 Wikipedia 页面。但本质上,make 所做的是查看规则,告诉它要“制作”哪些文件。它递归地查看所有规则来创建“目标”(例如,当您键入 make install 时,“安装”就是目标),然后遵循它们,直到(a)它到达目标或(b)它可怕地爆炸。我们都希望出现(a),但(b)也经常出现。 :)

不幸的是,在 Windows 领域,我们没有 make。或者编译器。无论如何,通常情况下。

dmake 是一个 make 程序,恰好在 Windows 上运行得很好。 Strawberry Perl 将您在 Windows 上的类 UNIX 环境中实际构建所需的所有内容打包到一个方便的包中,使您刚才所做的事情实际上成为可能。

When you see a Makefile.PL file, that means it's a module who's install system is ExtUtils::MakeMaker.

EU::MM is the classic system for installing Perl modules dating back to the dawn of CPAN. It relied on the fact that the program make--a common, and powerful dependency tracking tool--was available on almost every unix system, as well as relying on all sorts of unixy patterns and behaviors.

Makefile.PL is a Perl script that the author of the module maintains. It reads information about your system from Perl itself, and uses that to create a Makefile. This Makefile instructs make on actions to perform. For more information on make, check out The Wikipedia page on Make. Essentially though, what make does is look at rules, that tell it what files to 'make'. It recursively looks at all the rules to create the 'target' (eg, when you typed make install, 'install' was the target) and then follows them until (a) it reaches the target or (b) it explodes horribly. We all hope for (a), but (b) is often the case as well. :)

Unfortunately, in Windows-land, we don't have make. Or a compiler. Usually, anyway.

dmake is a make program that happens to run pretty well on Windows. Strawberry Perl packages up all the things you need to actually build in a unix-like environment on Windows into a convenient package, making what you just did actually possible.

尘曦 2024-09-07 10:38:16

这可能太字面地理解了您的问题,但是dmake有一个-v选项(用于verbose

dmake -v

dmake -v target

将显示有关 dmake 在安装过程中正在执行的操作的信息。

This may be taking your question too literally, but dmake has a -v option (for verbose)

dmake -v

dmake -v target

that will display information about exactly what dmake is doing during an installation.

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