Chapter 42. MakeMaker

Randy J. Ray

Tip

As this book goes to print, there is a nascent effort to replace MakeMaker with a program tentatively called makepmdist. No one can say yet whether this new program will unseat MakeMaker, but whatever happens, MakeMaker will remain a valid option for creating CPAN module distributions in the years ahead.

MakeMaker is one of the most-used modules among Perl developers. It creates a Makefile for your own modules so that they can be compiled and installed by other people on other platforms. MakeMaker insulates you from the vagaries of different operating systems such as compiler flags or the construction of dynamic libraries. It frees you to focus on the module itself rather than the installation process. If you’re writing a module that will be distributed on CPAN, or that needs to run on more than one architecture, MakeMaker is essential. This article assumes knowledge of basic configuration issues and the make command.

MakeMaker is the colloquial name for the ExtUtils::MakeMaker module. When loaded, it imports a set of core routines and a platform-specific library of routines. To MakeMaker, all Unix platforms are similar, since the Perl configuration process will already have identified the relevant differences between them. Thanks to MakeMaker, packages as operating-system– dependent as Perl/Tk will automatically build on platforms as diverse as VMS, Windows 98, Linux, and OS/2.

Reasons to Use MakeMaker

MakeMaker is absolutely necessary only when ...

Get Computer Science & Perl Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.