CINXE.COM
ExtUtils::MakeMaker - Create a module Makefile - Perldoc Browser
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>ExtUtils::MakeMaker - Create a module Makefile - Perldoc Browser</title> <link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser"> <link rel="canonical" href="https://perldoc.perl.org/ExtUtils::MakeMaker"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" /> <style> body { background: #f4f4f5; color: #020202; } .navbar-dark { background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%); background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%); background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0); background-repeat: repeat-x; } .navbar-dark .navbar-nav .nav-link, .navbar-dark .navbar-nav .nav-link:focus { color: #fff } .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 } #wrapperlicious { margin: 0 auto; font: 0.9em 'Helvetica Neue', Helvetica, sans-serif; font-weight: normal; line-height: 1.5em; margin: 0; padding: 0; } #wrapperlicious h1 { font-size: 1.5em } #wrapperlicious h2 { font-size: 1.3em } #wrapperlicious h3 { font-size: 1.1em } #wrapperlicious h4 { font-size: 0.9em } #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3, #wrapperlicious h4, #wrapperlicious dt { color: #020202; margin-top: 1em; margin-bottom: 1em; position: relative; font-weight: bold; } #wrapperlicious a { color: inherit; text-decoration: underline } #wrapperlicious #toc { text-decoration: none } #wrapperlicious a:hover { color: #2a2a2a } #wrapperlicious a img { border: 0 } #wrapperlicious :not(pre) > code { color: inherit; background-color: rgba(0, 0, 0, 0.04); border-radius: 3px; font: 0.9em Consolas, Menlo, Monaco, monospace; padding: 0.3em; } #wrapperlicious dd { margin: 0; margin-left: 2em; } #wrapperlicious dt { color: #2a2a2a; font-weight: bold; margin-left: 0.9em; } #wrapperlicious p { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious li > p { margin-bottom: 0; margin-top: 0; } #wrapperlicious pre { border: 1px solid #c1c1c1; border-radius: 3px; font: 100% Consolas, Menlo, Monaco, monospace; margin-bottom: 1em; margin-top: 1em; } #wrapperlicious pre > code { display: block; background-color: #f6f6f6; font: 0.9em Consolas, Menlo, Monaco, monospace; line-height: 1.5em; text-align: left; white-space: pre; padding: 1em; } #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul { margin-bottom: 1em; margin-top: 1em; } #wrapperlicious ul { list-style-type: square; } #wrapperlicious ul ul { margin-bottom: 0px; margin-top: 0px; } #footer { font-size: 0.8em; padding-top: 0.5em; text-align: center; } #more { display: inline; font-size: 0.8em; } #perldocdiv { background-color: #fff; border: 1px solid #c1c1c1; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; margin-left: auto; margin-right: auto; padding: 3em; padding-top: 1em; max-width: 960px; } #moduleversion { float: right } #wrapperlicious .leading-notice { font-style: italic; padding-left: 1em; margin-top: 1em; margin-bottom: 1em; } #wrapperlicious .permalink { display: none; left: -0.75em; position: absolute; padding-right: 0.25em; text-decoration: none; } #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink, #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink, #wrapperlicious dt:hover .permalink { display: block; } </style> <!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-KVNWBNT5FB'); gtag('config', 'UA-50555-3'); </script> </head> <body> <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="/"><img src="/images/perl_camel_30.png" width="30" height="30" class="d-inline-block align-top" alt="Perl Camel Logo"> Perldoc Browser</a> <div class="collapse navbar-collapse" id="navbarNav"> <ul class="navbar-nav mr-auto"> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.6.2</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-stable"> <a class="dropdown-item" href="/ExtUtils::MakeMaker">Latest</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1/ExtUtils::MakeMaker">5.40.1</a> <a class="dropdown-item" href="/5.40.0/ExtUtils::MakeMaker">5.40.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3/ExtUtils::MakeMaker">5.38.3</a> <a class="dropdown-item" href="/5.38.2/ExtUtils::MakeMaker">5.38.2</a> <a class="dropdown-item" href="/5.38.1/ExtUtils::MakeMaker">5.38.1</a> <a class="dropdown-item" href="/5.38.0/ExtUtils::MakeMaker">5.38.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.36.3/ExtUtils::MakeMaker">5.36.3</a> <a class="dropdown-item" href="/5.36.2/ExtUtils::MakeMaker">5.36.2</a> <a class="dropdown-item" href="/5.36.1/ExtUtils::MakeMaker">5.36.1</a> <a class="dropdown-item" href="/5.36.0/ExtUtils::MakeMaker">5.36.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.34.3/ExtUtils::MakeMaker">5.34.3</a> <a class="dropdown-item" href="/5.34.2/ExtUtils::MakeMaker">5.34.2</a> <a class="dropdown-item" href="/5.34.1/ExtUtils::MakeMaker">5.34.1</a> <a class="dropdown-item" href="/5.34.0/ExtUtils::MakeMaker">5.34.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.32.1/ExtUtils::MakeMaker">5.32.1</a> <a class="dropdown-item" href="/5.32.0/ExtUtils::MakeMaker">5.32.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.30.3/ExtUtils::MakeMaker">5.30.3</a> <a class="dropdown-item" href="/5.30.2/ExtUtils::MakeMaker">5.30.2</a> <a class="dropdown-item" href="/5.30.1/ExtUtils::MakeMaker">5.30.1</a> <a class="dropdown-item" href="/5.30.0/ExtUtils::MakeMaker">5.30.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.28.3/ExtUtils::MakeMaker">5.28.3</a> <a class="dropdown-item" href="/5.28.2/ExtUtils::MakeMaker">5.28.2</a> <a class="dropdown-item" href="/5.28.1/ExtUtils::MakeMaker">5.28.1</a> <a class="dropdown-item" href="/5.28.0/ExtUtils::MakeMaker">5.28.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.26.3/ExtUtils::MakeMaker">5.26.3</a> <a class="dropdown-item" href="/5.26.2/ExtUtils::MakeMaker">5.26.2</a> <a class="dropdown-item" href="/5.26.1/ExtUtils::MakeMaker">5.26.1</a> <a class="dropdown-item" href="/5.26.0/ExtUtils::MakeMaker">5.26.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.24.4/ExtUtils::MakeMaker">5.24.4</a> <a class="dropdown-item" href="/5.24.3/ExtUtils::MakeMaker">5.24.3</a> <a class="dropdown-item" href="/5.24.2/ExtUtils::MakeMaker">5.24.2</a> <a class="dropdown-item" href="/5.24.1/ExtUtils::MakeMaker">5.24.1</a> <a class="dropdown-item" href="/5.24.0/ExtUtils::MakeMaker">5.24.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.22.4/ExtUtils::MakeMaker">5.22.4</a> <a class="dropdown-item" href="/5.22.3/ExtUtils::MakeMaker">5.22.3</a> <a class="dropdown-item" href="/5.22.2/ExtUtils::MakeMaker">5.22.2</a> <a class="dropdown-item" href="/5.22.1/ExtUtils::MakeMaker">5.22.1</a> <a class="dropdown-item" href="/5.22.0/ExtUtils::MakeMaker">5.22.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.20.3/ExtUtils::MakeMaker">5.20.3</a> <a class="dropdown-item" href="/5.20.2/ExtUtils::MakeMaker">5.20.2</a> <a class="dropdown-item" href="/5.20.1/ExtUtils::MakeMaker">5.20.1</a> <a class="dropdown-item" href="/5.20.0/ExtUtils::MakeMaker">5.20.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.18.4/ExtUtils::MakeMaker">5.18.4</a> <a class="dropdown-item" href="/5.18.3/ExtUtils::MakeMaker">5.18.3</a> <a class="dropdown-item" href="/5.18.2/ExtUtils::MakeMaker">5.18.2</a> <a class="dropdown-item" href="/5.18.1/ExtUtils::MakeMaker">5.18.1</a> <a class="dropdown-item" href="/5.18.0/ExtUtils::MakeMaker">5.18.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.16.3/ExtUtils::MakeMaker">5.16.3</a> <a class="dropdown-item" href="/5.16.2/ExtUtils::MakeMaker">5.16.2</a> <a class="dropdown-item" href="/5.16.1/ExtUtils::MakeMaker">5.16.1</a> <a class="dropdown-item" href="/5.16.0/ExtUtils::MakeMaker">5.16.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.14.4/ExtUtils::MakeMaker">5.14.4</a> <a class="dropdown-item" href="/5.14.3/ExtUtils::MakeMaker">5.14.3</a> <a class="dropdown-item" href="/5.14.2/ExtUtils::MakeMaker">5.14.2</a> <a class="dropdown-item" href="/5.14.1/ExtUtils::MakeMaker">5.14.1</a> <a class="dropdown-item" href="/5.14.0/ExtUtils::MakeMaker">5.14.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.12.5/ExtUtils::MakeMaker">5.12.5</a> <a class="dropdown-item" href="/5.12.4/ExtUtils::MakeMaker">5.12.4</a> <a class="dropdown-item" href="/5.12.3/ExtUtils::MakeMaker">5.12.3</a> <a class="dropdown-item" href="/5.12.2/ExtUtils::MakeMaker">5.12.2</a> <a class="dropdown-item" href="/5.12.1/ExtUtils::MakeMaker">5.12.1</a> <a class="dropdown-item" href="/5.12.0/ExtUtils::MakeMaker">5.12.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.10.1/ExtUtils::MakeMaker">5.10.1</a> <a class="dropdown-item" href="/5.10.0/ExtUtils::MakeMaker">5.10.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.8.9/ExtUtils::MakeMaker">5.8.9</a> <a class="dropdown-item" href="/5.8.8/ExtUtils::MakeMaker">5.8.8</a> <a class="dropdown-item" href="/5.8.7/ExtUtils::MakeMaker">5.8.7</a> <a class="dropdown-item" href="/5.8.6/ExtUtils::MakeMaker">5.8.6</a> <a class="dropdown-item" href="/5.8.5/ExtUtils::MakeMaker">5.8.5</a> <a class="dropdown-item" href="/5.8.4/ExtUtils::MakeMaker">5.8.4</a> <a class="dropdown-item" href="/5.8.3/ExtUtils::MakeMaker">5.8.3</a> <a class="dropdown-item" href="/5.8.2/ExtUtils::MakeMaker">5.8.2</a> <a class="dropdown-item" href="/5.8.1/ExtUtils::MakeMaker">5.8.1</a> <a class="dropdown-item" href="/5.8.0/ExtUtils::MakeMaker">5.8.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item active" href="/5.6.2/ExtUtils::MakeMaker">5.6.2</a> <a class="dropdown-item" href="/5.6.1/ExtUtils::MakeMaker">5.6.1</a> <a class="dropdown-item" href="/5.6.0/ExtUtils::MakeMaker">5.6.0</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.005_04/ExtUtils::MakeMaker">5.005_04</a> <a class="dropdown-item" href="/5.005_03/ExtUtils::MakeMaker">5.005_03</a> <a class="dropdown-item" href="/5.005_02/ExtUtils::MakeMaker">5.005_02</a> <a class="dropdown-item" href="/5.005_01/ExtUtils::MakeMaker">5.005_01</a> <a class="dropdown-item" href="/5.005/ExtUtils::MakeMaker">5.005</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-dev"> <a class="dropdown-item" href="/blead/ExtUtils::MakeMaker">blead</a> <a class="dropdown-item" href="/5.41.10/ExtUtils::MakeMaker">5.41.10</a> <a class="dropdown-item" href="/5.41.9/ExtUtils::MakeMaker">5.41.9</a> <a class="dropdown-item" href="/5.41.8/ExtUtils::MakeMaker">5.41.8</a> <a class="dropdown-item" href="/5.41.7/ExtUtils::MakeMaker">5.41.7</a> <a class="dropdown-item" href="/5.41.6/ExtUtils::MakeMaker">5.41.6</a> <a class="dropdown-item" href="/5.41.5/ExtUtils::MakeMaker">5.41.5</a> <a class="dropdown-item" href="/5.41.4/ExtUtils::MakeMaker">5.41.4</a> <a class="dropdown-item" href="/5.41.3/ExtUtils::MakeMaker">5.41.3</a> <a class="dropdown-item" href="/5.41.2/ExtUtils::MakeMaker">5.41.2</a> <a class="dropdown-item" href="/5.41.1/ExtUtils::MakeMaker">5.41.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.40.1-RC1/ExtUtils::MakeMaker">5.40.1-RC1</a> <a class="dropdown-item" href="/5.40.0-RC2/ExtUtils::MakeMaker">5.40.0-RC2</a> <a class="dropdown-item" href="/5.40.0-RC1/ExtUtils::MakeMaker">5.40.0-RC1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.39.10/ExtUtils::MakeMaker">5.39.10</a> <a class="dropdown-item" href="/5.39.9/ExtUtils::MakeMaker">5.39.9</a> <a class="dropdown-item" href="/5.39.8/ExtUtils::MakeMaker">5.39.8</a> <a class="dropdown-item" href="/5.39.7/ExtUtils::MakeMaker">5.39.7</a> <a class="dropdown-item" href="/5.39.6/ExtUtils::MakeMaker">5.39.6</a> <a class="dropdown-item" href="/5.39.5/ExtUtils::MakeMaker">5.39.5</a> <a class="dropdown-item" href="/5.39.4/ExtUtils::MakeMaker">5.39.4</a> <a class="dropdown-item" href="/5.39.3/ExtUtils::MakeMaker">5.39.3</a> <a class="dropdown-item" href="/5.39.2/ExtUtils::MakeMaker">5.39.2</a> <a class="dropdown-item" href="/5.39.1/ExtUtils::MakeMaker">5.39.1</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.38.3-RC1/ExtUtils::MakeMaker">5.38.3-RC1</a> </div> </li> <li class="nav-item dropdown text-nowrap"> <a class="nav-link dropdown-toggle" href="#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a> <div class="dropdown-menu" aria-labelledby="dropdownlink-nav"> <a class="dropdown-item" href="/5.6.2/perl">Perl</a> <a class="dropdown-item" href="/5.6.2/perlintro">Intro</a> <a class="dropdown-item" href="/5.6.2/perl#Tutorials">Tutorials</a> <a class="dropdown-item" href="/5.6.2/perlfaq">FAQs</a> <a class="dropdown-item" href="/5.6.2/perl#Reference-Manual">Reference</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.2/perlop">Operators</a> <a class="dropdown-item" href="/5.6.2/functions">Functions</a> <a class="dropdown-item" href="/5.6.2/variables">Variables</a> <a class="dropdown-item" href="/5.6.2/modules">Modules</a> <a class="dropdown-item" href="/5.6.2/perlutil">Utilities</a> <div class="dropdown-divider"></div> <a class="dropdown-item" href="/5.6.2/perldelta">Release Notes</a> <a class="dropdown-item" href="/5.6.2/perlcommunity">Community</a> <a class="dropdown-item" href="/5.6.2/perlhist">History</a> </div> </li> </ul> <ul class="navbar-nav"> <script> function set_expand (expand) { var perldocdiv = document.getElementById('perldocdiv'); var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width'); var expanded = (width == '' || width == 'none') ? true : false; if (expand === null) { expand = !expanded; } if ((expand && !expanded) || (!expand && expanded)) { perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px'); var button_classlist = document.getElementById('content-expand-button').classList; if (expand) { button_classlist.add('btn-light'); button_classlist.remove('btn-outline-light'); } else { button_classlist.add('btn-outline-light'); button_classlist.remove('btn-light'); } } return expand; } function toggle_expand () { var expand = set_expand(null); document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC'; } function read_expand () { return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 }); } if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', function () { if (read_expand()) { set_expand(true); } }); } else if (read_expand()) { set_expand(true); } </script> <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-4" onclick="toggle_expand()">Expand</button> </ul> <form class="form-inline" method="get" action="/5.6.2/search"> <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search" value=""> </form> </div> </nav> <div id="wrapperlicious" class="container-fluid"> <div id="perldocdiv"> <div id="links"> <a href="/5.6.2/ExtUtils::MakeMaker">ExtUtils::MakeMaker</a> <div id="more"> (<a href="/5.6.2/ExtUtils::MakeMaker.txt">source</a>, <a href="https://metacpan.org/pod/ExtUtils::MakeMaker">CPAN</a>) </div> <div id="moduleversion">version 6.17</div> </div> <div class="leading-notice"> You are viewing the version of this documentation from Perl 5.6.2. <a href="/ExtUtils::MakeMaker">View the latest version</a> </div> <h1><a id="toc">CONTENTS</a></h1> <ul> <li> <a class="text-decoration-none" href="#NAME">NAME</a> </li> <li> <a class="text-decoration-none" href="#SYNOPSIS">SYNOPSIS</a> </li> <li> <a class="text-decoration-none" href="#DESCRIPTION">DESCRIPTION</a> <ul> <li> <a class="text-decoration-none" href="#How-To-Write-A-Makefile.PL">How To Write A Makefile.PL</a> </li> <li> <a class="text-decoration-none" href="#Default-Makefile-Behaviour">Default Makefile Behaviour</a> </li> <li> <a class="text-decoration-none" href="#make-test">make test</a> </li> <li> <a class="text-decoration-none" href="#make-testdb">make testdb</a> </li> <li> <a class="text-decoration-none" href="#make-install">make install</a> </li> <li> <a class="text-decoration-none" href="#PREFIX-and-LIB-attribute">PREFIX and LIB attribute</a> </li> <li> <a class="text-decoration-none" href="#AFS-users">AFS users</a> </li> <li> <a class="text-decoration-none" href="#Static-Linking-of-a-new-Perl-Binary">Static Linking of a new Perl Binary</a> </li> <li> <a class="text-decoration-none" href="#Determination-of-Perl-Library-and-Installation-Locations">Determination of Perl Library and Installation Locations</a> </li> <li> <a class="text-decoration-none" href="#Which-architecture-dependent-directory?">Which architecture dependent directory?</a> </li> <li> <a class="text-decoration-none" href="#Using-Attributes-and-Parameters">Using Attributes and Parameters</a> </li> <li> <a class="text-decoration-none" href="#Additional-lowercase-attributes">Additional lowercase attributes</a> </li> <li> <a class="text-decoration-none" href="#Overriding-MakeMaker-Methods">Overriding MakeMaker Methods</a> </li> <li> <a class="text-decoration-none" href="#The-End-Of-Cargo-Cult-Programming">The End Of Cargo Cult Programming</a> </li> <li> <a class="text-decoration-none" href="#Hintsfile-support">Hintsfile support</a> </li> <li> <a class="text-decoration-none" href="#Distribution-Support">Distribution Support</a> </li> <li> <a class="text-decoration-none" href="#Module-Meta-Data">Module Meta-Data</a> </li> <li> <a class="text-decoration-none" href="#Disabling-an-extension">Disabling an extension</a> </li> <li> <a class="text-decoration-none" href="#Other-Handy-Functions">Other Handy Functions</a> </li> </ul> </li> <li> <a class="text-decoration-none" href="#ENVIRONMENT">ENVIRONMENT</a> </li> <li> <a class="text-decoration-none" href="#SEE-ALSO">SEE ALSO</a> </li> <li> <a class="text-decoration-none" href="#AUTHORS">AUTHORS</a> </li> <li> <a class="text-decoration-none" href="#LICENSE">LICENSE</a> </li> </ul> <h1 id="NAME"><a class="permalink" href="#NAME">#</a>NAME</h1> <p>ExtUtils::MakeMaker - Create a module Makefile</p> <h1 id="SYNOPSIS"><a class="permalink" href="#SYNOPSIS">#</a>SYNOPSIS</h1> <pre><code>use ExtUtils::MakeMaker; WriteMakefile( ATTRIBUTE => VALUE [, ...] );</code></pre> <h1 id="DESCRIPTION"><a class="permalink" href="#DESCRIPTION">#</a>DESCRIPTION</h1> <p>This utility is designed to write a Makefile for an extension module from a Makefile.PL. It is based on the Makefile.SH model provided by Andy Dougherty and the perl5-porters.</p> <p>It splits the task of generating the Makefile into several subroutines that can be individually overridden. Each subroutine returns the text it wishes to have written to the Makefile.</p> <p>MakeMaker is object oriented. Each directory below the current directory that contains a Makefile.PL is treated as a separate object. This makes it possible to write an unlimited number of Makefiles with a single invocation of WriteMakefile().</p> <h2 id="How-To-Write-A-Makefile.PL"><a class="permalink" href="#How-To-Write-A-Makefile.PL">#</a><a id="How"></a>How To Write A Makefile.PL</h2> <p>See ExtUtils::MakeMaker::Tutorial.</p> <p>The long answer is the rest of the manpage :-)</p> <h2 id="Default-Makefile-Behaviour"><a class="permalink" href="#Default-Makefile-Behaviour">#</a><a id="Default"></a>Default Makefile Behaviour</h2> <p>The generated Makefile enables the user of the extension to invoke</p> <pre><code class="plaintext">perl Makefile.PL # optionally "perl Makefile.PL verbose" make make test # optionally set TEST_VERBOSE=1 make install # See below</code></pre> <p>The Makefile to be produced may be altered by adding arguments of the form <code>KEY=VALUE</code>. E.g.</p> <pre><code class="plaintext">perl Makefile.PL PREFIX=/tmp/myperl5</code></pre> <p>Other interesting targets in the generated Makefile are</p> <pre><code class="plaintext">make config # to check if the Makefile is up-to-date make clean # delete local temp files (Makefile gets renamed) make realclean # delete derived files (including ./blib) make ci # check in all the files in the MANIFEST file make dist # see below the Distribution Support section</code></pre> <h2 id="make-test"><a class="permalink" href="#make-test">#</a><a id="make"></a>make test</h2> <p>MakeMaker checks for the existence of a file named <i>test.pl</i> in the current directory and if it exists it execute the script with the proper set of perl <code>-I</code> options.</p> <p>MakeMaker also checks for any files matching glob("t/*.t"). It will execute all matching files in alphabetical order via the <a href="/5.6.2/Test::Harness">Test::Harness</a> module with the <code>-I</code> switches set correctly.</p> <p>If you'd like to see the raw output of your tests, set the <code>TEST_VERBOSE</code> variable to true.</p> <pre><code class="plaintext">make test TEST_VERBOSE=1</code></pre> <h2 id="make-testdb"><a class="permalink" href="#make-testdb">#</a><a id="make1"></a>make testdb</h2> <p>A useful variation of the above is the target <code>testdb</code>. It runs the test under the Perl debugger (see <a href="/5.6.2/perldebug">perldebug</a>). If the file <i>test.pl</i> exists in the current directory, it is used for the test.</p> <p>If you want to debug some other testfile, set the <code>TEST_FILE</code> variable thusly:</p> <pre><code class="plaintext">make testdb TEST_FILE=t/mytest.t</code></pre> <p>By default the debugger is called using <code>-d</code> option to perl. If you want to specify some other option, set the <code>TESTDB_SW</code> variable:</p> <pre><code class="plaintext">make testdb TESTDB_SW=-Dx</code></pre> <h2 id="make-install"><a class="permalink" href="#make-install">#</a><a id="make2"></a>make install</h2> <p>make alone puts all relevant files into directories that are named by the macros INST_LIB, INST_ARCHLIB, INST_SCRIPT, INST_MAN1DIR and INST_MAN3DIR. All these default to something below ./blib if you are <i>not</i> building below the perl source directory. If you <i>are</i> building below the perl source, INST_LIB and INST_ARCHLIB default to ../../lib, and INST_SCRIPT is not defined.</p> <p>The <i>install</i> target of the generated Makefile copies the files found below each of the INST_* directories to their INSTALL* counterparts. Which counterparts are chosen depends on the setting of INSTALLDIRS according to the following table:</p> <pre><code class="plaintext"> INSTALLDIRS set to perl site vendor PERLPREFIX SITEPREFIX VENDORPREFIX INST_ARCHLIB INSTALLARCHLIB INSTALLSITEARCH INSTALLVENDORARCH INST_LIB INSTALLPRIVLIB INSTALLSITELIB INSTALLVENDORLIB INST_BIN INSTALLBIN INSTALLSITEBIN INSTALLVENDORBIN INST_SCRIPT INSTALLSCRIPT INSTALLSCRIPT INSTALLSCRIPT INST_MAN1DIR INSTALLMAN1DIR INSTALLSITEMAN1DIR INSTALLVENDORMAN1DIR INST_MAN3DIR INSTALLMAN3DIR INSTALLSITEMAN3DIR INSTALLVENDORMAN3DIR</code></pre> <p>The INSTALL... macros in turn default to their %Config ($Config{installprivlib}, $Config{installarchlib}, etc.) counterparts.</p> <p>You can check the values of these variables on your system with</p> <pre><code class="plaintext">perl '-V:install.*'</code></pre> <p>And to check the sequence in which the library directories are searched by perl, run</p> <pre><code>perl -le 'print join $/, @INC'</code></pre> <h2 id="PREFIX-and-LIB-attribute"><a class="permalink" href="#PREFIX-and-LIB-attribute">#</a><a id="PREFIX1"></a>PREFIX and LIB attribute</h2> <p>PREFIX and LIB can be used to set several INSTALL* attributes in one go. The quickest way to install a module in a non-standard place might be</p> <pre><code class="plaintext">perl Makefile.PL PREFIX=~</code></pre> <p>This will install all files in the module under your home directory, with man pages and libraries going into an appropriate place (usually ~/man and ~/lib).</p> <p>Another way to specify many INSTALL directories with a single parameter is LIB.</p> <pre><code class="plaintext">perl Makefile.PL LIB=~/lib</code></pre> <p>This will install the module's architecture-independent files into ~/lib, the architecture-dependent files into ~/lib/$archname.</p> <p>Note, that in both cases the tilde expansion is done by MakeMaker, not by perl by default, nor by make.</p> <p>Conflicts between parameters LIB, PREFIX and the various INSTALL* arguments are resolved so that:</p> <ul> <li><p>setting LIB overrides any setting of INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLSITELIB, INSTALLSITEARCH (and they are not affected by PREFIX);</p> </li> <li><p>without LIB, setting PREFIX replaces the initial <code>$Config{prefix}</code> part of those INSTALL* arguments, even if the latter are explicitly set (but are set to still start with <code>$Config{prefix}</code>).</p> </li> </ul> <p>If the user has superuser privileges, and is not working on AFS or relatives, then the defaults for INSTALLPRIVLIB, INSTALLARCHLIB, INSTALLSCRIPT, etc. will be appropriate, and this incantation will be the best:</p> <pre><code>perl Makefile.PL; make; make test make install</code></pre> <p>make install per default writes some documentation of what has been done into the file <code>$(INSTALLARCHLIB)/perllocal.pod</code>. This feature can be bypassed by calling make pure_install.</p> <h2 id="AFS-users"><a class="permalink" href="#AFS-users">#</a><a id="AFS"></a>AFS users</h2> <p>will have to specify the installation directories as these most probably have changed since perl itself has been installed. They will have to do this by calling</p> <pre><code class="plaintext">perl Makefile.PL INSTALLSITELIB=/afs/here/today \ INSTALLSCRIPT=/afs/there/now INSTALLMAN3DIR=/afs/for/manpages make</code></pre> <p>Be careful to repeat this procedure every time you recompile an extension, unless you are sure the AFS installation directories are still valid.</p> <h2 id="Static-Linking-of-a-new-Perl-Binary"><a class="permalink" href="#Static-Linking-of-a-new-Perl-Binary">#</a><a id="Static"></a>Static Linking of a new Perl Binary</h2> <p>An extension that is built with the above steps is ready to use on systems supporting dynamic loading. On systems that do not support dynamic loading, any newly created extension has to be linked together with the available resources. MakeMaker supports the linking process by creating appropriate targets in the Makefile whenever an extension is built. You can invoke the corresponding section of the makefile with</p> <pre><code class="plaintext">make perl</code></pre> <p>That produces a new perl binary in the current directory with all extensions linked in that can be found in INST_ARCHLIB, SITELIBEXP, and PERL_ARCHLIB. To do that, MakeMaker writes a new Makefile, on UNIX, this is called Makefile.aperl (may be system dependent). If you want to force the creation of a new perl, it is recommended, that you delete this Makefile.aperl, so the directories are searched-through for linkable libraries again.</p> <p>The binary can be installed into the directory where perl normally resides on your machine with</p> <pre><code class="plaintext">make inst_perl</code></pre> <p>To produce a perl binary with a different name than <code>perl</code>, either say</p> <pre><code class="plaintext">perl Makefile.PL MAP_TARGET=myperl make myperl make inst_perl</code></pre> <p>or say</p> <pre><code class="plaintext">perl Makefile.PL make myperl MAP_TARGET=myperl make inst_perl MAP_TARGET=myperl</code></pre> <p>In any case you will be prompted with the correct invocation of the <code>inst_perl</code> target that installs the new binary into INSTALLBIN.</p> <p>make inst_perl per default writes some documentation of what has been done into the file <code>$(INSTALLARCHLIB)/perllocal.pod</code>. This can be bypassed by calling make pure_inst_perl.</p> <p>Warning: the inst_perl: target will most probably overwrite your existing perl binary. Use with care!</p> <p>Sometimes you might want to build a statically linked perl although your system supports dynamic loading. In this case you may explicitly set the linktype with the invocation of the Makefile.PL or make:</p> <pre><code class="plaintext">perl Makefile.PL LINKTYPE=static # recommended</code></pre> <p>or</p> <pre><code class="plaintext">make LINKTYPE=static # works on most systems</code></pre> <h2 id="Determination-of-Perl-Library-and-Installation-Locations"><a class="permalink" href="#Determination-of-Perl-Library-and-Installation-Locations">#</a><a id="Determination"></a>Determination of Perl Library and Installation Locations</h2> <p>MakeMaker needs to know, or to guess, where certain things are located. Especially INST_LIB and INST_ARCHLIB (where to put the files during the make(1) run), PERL_LIB and PERL_ARCHLIB (where to read existing modules from), and PERL_INC (header files and <code>libperl*.*</code>).</p> <p>Extensions may be built either using the contents of the perl source directory tree or from the installed perl library. The recommended way is to build extensions after you have run 'make install' on perl itself. You can do that in any directory on your hard disk that is not below the perl source tree. The support for extensions below the ext directory of the perl distribution is only good for the standard extensions that come with perl.</p> <p>If an extension is being built below the <code>ext/</code> directory of the perl source then MakeMaker will set PERL_SRC automatically (e.g., <code>../..</code>). If PERL_SRC is defined and the extension is recognized as a standard extension, then other variables default to the following:</p> <pre><code class="plaintext">PERL_INC = PERL_SRC PERL_LIB = PERL_SRC/lib PERL_ARCHLIB = PERL_SRC/lib INST_LIB = PERL_LIB INST_ARCHLIB = PERL_ARCHLIB</code></pre> <p>If an extension is being built away from the perl source then MakeMaker will leave PERL_SRC undefined and default to using the installed copy of the perl library. The other variables default to the following:</p> <pre><code>PERL_INC = $archlibexp/CORE PERL_LIB = $privlibexp PERL_ARCHLIB = $archlibexp INST_LIB = ./blib/lib INST_ARCHLIB = ./blib/arch</code></pre> <p>If perl has not yet been installed then PERL_SRC can be defined on the command line as shown in the previous section.</p> <h2 id="Which-architecture-dependent-directory?"><a class="permalink" href="#Which-architecture-dependent-directory?">#</a><a id="Which"></a><a id="Which-architecture-dependent-directory"></a>Which architecture dependent directory?</h2> <p>If you don't want to keep the defaults for the INSTALL* macros, MakeMaker helps you to minimize the typing needed: the usual relationship between INSTALLPRIVLIB and INSTALLARCHLIB is determined by Configure at perl compilation time. MakeMaker supports the user who sets INSTALLPRIVLIB. If INSTALLPRIVLIB is set, but INSTALLARCHLIB not, then MakeMaker defaults the latter to be the same subdirectory of INSTALLPRIVLIB as Configure decided for the counterparts in %Config , otherwise it defaults to INSTALLPRIVLIB. The same relationship holds for INSTALLSITELIB and INSTALLSITEARCH.</p> <p>MakeMaker gives you much more freedom than needed to configure internal variables and get different results. It is worth to mention, that make(1) also lets you configure most of the variables that are used in the Makefile. But in the majority of situations this will not be necessary, and should only be done if the author of a package recommends it (or you know what you're doing).</p> <h2 id="Using-Attributes-and-Parameters"><a class="permalink" href="#Using-Attributes-and-Parameters">#</a><a id="Using"></a>Using Attributes and Parameters</h2> <p>The following attributes may be specified as arguments to WriteMakefile() or as NAME=VALUE pairs on the command line.</p> <dl> <dt id="ABSTRACT"><a class="permalink" href="#ABSTRACT">#</a>ABSTRACT</dt> <dd> <p>One line description of the module. Will be included in PPD file.</p> </dd> <dt id="ABSTRACT_FROM"><a class="permalink" href="#ABSTRACT_FROM">#</a>ABSTRACT_FROM</dt> <dd> <p>Name of the file that contains the package description. MakeMaker looks for a line in the POD matching /^($package\s-\s)(.*)/. This is typically the first line in the "=head1 NAME" section. $2 becomes the abstract.</p> </dd> <dt id="AUTHOR"><a class="permalink" href="#AUTHOR">#</a>AUTHOR</dt> <dd> <p>String containing name (and email address) of package author(s). Is used in PPD (Perl Package Description) files for PPM (Perl Package Manager).</p> </dd> <dt id="BINARY_LOCATION"><a class="permalink" href="#BINARY_LOCATION">#</a>BINARY_LOCATION</dt> <dd> <p>Used when creating PPD files for binary packages. It can be set to a full or relative path or URL to the binary archive for a particular architecture. For example:</p> <pre><code class="plaintext">perl Makefile.PL BINARY_LOCATION=x86/Agent.tar.gz</code></pre> <p>builds a PPD package that references a binary of the <code>Agent</code> package, located in the <code>x86</code> directory relative to the PPD itself.</p> </dd> <dt id="C"><a class="permalink" href="#C">#</a>C</dt> <dd> <p>Ref to array of *.c file names. Initialised from a directory scan and the values portion of the XS attribute hash. This is not currently used by MakeMaker but may be handy in Makefile.PLs.</p> </dd> <dt id="CCFLAGS"><a class="permalink" href="#CCFLAGS">#</a>CCFLAGS</dt> <dd> <p>String that will be included in the compiler call command line between the arguments INC and OPTIMIZE.</p> </dd> <dt id="CONFIG"><a class="permalink" href="#CONFIG">#</a>CONFIG</dt> <dd> <p>Arrayref. E.g. [qw(archname manext)] defines ARCHNAME & MANEXT from config.sh. MakeMaker will add to CONFIG the following values anyway: ar cc cccdlflags ccdlflags dlext dlsrc ld lddlflags ldflags libc lib_ext obj_ext ranlib sitelibexp sitearchexp so</p> </dd> <dt id="CONFIGURE"><a class="permalink" href="#CONFIGURE">#</a>CONFIGURE</dt> <dd> <p>CODE reference. The subroutine should return a hash reference. The hash may contain further attributes, e.g. {LIBS => ...}, that have to be determined by some evaluation method.</p> </dd> <dt id="DEFINE"><a class="permalink" href="#DEFINE">#</a>DEFINE</dt> <dd> <p>Something like <code>"-DHAVE_UNISTD_H"</code></p> </dd> <dt id="DESTDIR"><a class="permalink" href="#DESTDIR">#</a>DESTDIR</dt> <dd> <p>This is the root directory into which the code will be installed. It <i>prepends itself to the normal prefix</i>. For example, if your code would normally go into /usr/local/lib/perl you could set DESTDIR=/tmp/ and installation would go into /tmp/usr/local/lib/perl.</p> <p>This is primarily of use for people who repackage Perl modules.</p> <p>NOTE: Due to the nature of make, it is important that you put the trailing slash on your DESTDIR. "/tmp/" not "/tmp".</p> </dd> <dt id="DIR"><a class="permalink" href="#DIR">#</a>DIR</dt> <dd> <p>Ref to array of subdirectories containing Makefile.PLs e.g. [ 'sdbm' ] in ext/SDBM_File</p> </dd> <dt id="DISTNAME"><a class="permalink" href="#DISTNAME">#</a>DISTNAME</dt> <dd> <p>A safe filename for the package.</p> <p>Defaults to NAME above but with :: replaced with -.</p> <p>For example, Foo::Bar becomes Foo-Bar.</p> </dd> <dt id="DISTVNAME"><a class="permalink" href="#DISTVNAME">#</a>DISTVNAME</dt> <dd> <p>Your name for distributing the package with the version number included. This is used by 'make dist' to name the resulting archive file.</p> <p>Defaults to DISTNAME-VERSION.</p> <p>For example, version 1.04 of Foo::Bar becomes Foo-Bar-1.04.</p> <p>On some OS's where . has special meaning VERSION_SYM may be used in place of VERSION.</p> </dd> <dt id="DL_FUNCS"><a class="permalink" href="#DL_FUNCS">#</a>DL_FUNCS</dt> <dd> <p>Hashref of symbol names for routines to be made available as universal symbols. Each key/value pair consists of the package name and an array of routine names in that package. Used only under AIX, OS/2, VMS and Win32 at present. The routine names supplied will be expanded in the same way as XSUB names are expanded by the XS() macro. Defaults to</p> <pre><code class="plaintext">{"$(NAME)" => ["boot_$(NAME)" ] }</code></pre> <p>e.g.</p> <pre><code class="plaintext">{"RPC" => [qw( boot_rpcb rpcb_gettime getnetconfigent )], "NetconfigPtr" => [ 'DESTROY'] }</code></pre> <p>Please see the <a href="/5.6.2/ExtUtils::Mksymlists">ExtUtils::Mksymlists</a> documentation for more information about the DL_FUNCS, DL_VARS and FUNCLIST attributes.</p> </dd> <dt id="DL_VARS"><a class="permalink" href="#DL_VARS">#</a>DL_VARS</dt> <dd> <p>Array of symbol names for variables to be made available as universal symbols. Used only under AIX, OS/2, VMS and Win32 at present. Defaults to []. (e.g. [ qw(Foo_version Foo_numstreams Foo_tree ) ])</p> </dd> <dt id="EXCLUDE_EXT"><a class="permalink" href="#EXCLUDE_EXT">#</a>EXCLUDE_EXT</dt> <dd> <p>Array of extension names to exclude when doing a static build. This is ignored if INCLUDE_EXT is present. Consult INCLUDE_EXT for more details. (e.g. [ qw( Socket POSIX ) ] )</p> <p>This attribute may be most useful when specified as a string on the command line: perl Makefile.PL EXCLUDE_EXT='Socket Safe'</p> </dd> <dt id="EXE_FILES"><a class="permalink" href="#EXE_FILES">#</a>EXE_FILES</dt> <dd> <p>Ref to array of executable files. The files will be copied to the INST_SCRIPT directory. Make realclean will delete them from there again.</p> <p>If your executables start with something like #!perl or #!/usr/bin/perl MakeMaker will change this to the path of the perl 'Makefile.PL' was invoked with so the programs will be sure to run properly even if perl is not in /usr/bin/perl.</p> </dd> <dt id="FIRST_MAKEFILE"><a class="permalink" href="#FIRST_MAKEFILE">#</a>FIRST_MAKEFILE</dt> <dd> <p>The name of the Makefile to be produced. This is used for the second Makefile that will be produced for the MAP_TARGET.</p> <p>Defaults to 'Makefile' or 'Descrip.MMS' on VMS.</p> <p>(Note: we couldn't use MAKEFILE because dmake uses this for something else).</p> </dd> <dt id="FULLPERL"><a class="permalink" href="#FULLPERL">#</a>FULLPERL</dt> <dd> <p>Perl binary able to run this extension, load XS modules, etc...</p> </dd> <dt id="FULLPERLRUN"><a class="permalink" href="#FULLPERLRUN">#</a>FULLPERLRUN</dt> <dd> <p>Like PERLRUN, except it uses FULLPERL.</p> </dd> <dt id="FULLPERLRUNINST"><a class="permalink" href="#FULLPERLRUNINST">#</a>FULLPERLRUNINST</dt> <dd> <p>Like PERLRUNINST, except it uses FULLPERL.</p> </dd> <dt id="FUNCLIST"><a class="permalink" href="#FUNCLIST">#</a>FUNCLIST</dt> <dd> <p>This provides an alternate means to specify function names to be exported from the extension. Its value is a reference to an array of function names to be exported by the extension. These names are passed through unaltered to the linker options file.</p> </dd> <dt id="H"><a class="permalink" href="#H">#</a>H</dt> <dd> <p>Ref to array of *.h file names. Similar to C.</p> </dd> <dt id="IMPORTS"><a class="permalink" href="#IMPORTS">#</a>IMPORTS</dt> <dd> <p>This attribute is used to specify names to be imported into the extension. Takes a hash ref.</p> <p>It is only used on OS/2 and Win32.</p> </dd> <dt id="INC"><a class="permalink" href="#INC">#</a>INC</dt> <dd> <p>Include file dirs eg: <code>"-I/usr/5include -I/path/to/inc"</code></p> </dd> <dt id="INCLUDE_EXT"><a class="permalink" href="#INCLUDE_EXT">#</a>INCLUDE_EXT</dt> <dd> <p>Array of extension names to be included when doing a static build. MakeMaker will normally build with all of the installed extensions when doing a static build, and that is usually the desired behavior. If INCLUDE_EXT is present then MakeMaker will build only with those extensions which are explicitly mentioned. (e.g. [ qw( Socket POSIX ) ])</p> <p>It is not necessary to mention DynaLoader or the current extension when filling in INCLUDE_EXT. If the INCLUDE_EXT is mentioned but is empty then only DynaLoader and the current extension will be included in the build.</p> <p>This attribute may be most useful when specified as a string on the command line: perl Makefile.PL INCLUDE_EXT='POSIX Socket Devel::Peek'</p> </dd> <dt id="INSTALLARCHLIB"><a class="permalink" href="#INSTALLARCHLIB">#</a>INSTALLARCHLIB</dt> <dd> <p>Used by 'make install', which copies files from INST_ARCHLIB to this directory if INSTALLDIRS is set to perl.</p> </dd> <dt id="INSTALLBIN"><a class="permalink" href="#INSTALLBIN">#</a>INSTALLBIN</dt> <dd> <p>Directory to install binary files (e.g. tkperl) into if INSTALLDIRS=perl.</p> </dd> <dt id="INSTALLDIRS"><a class="permalink" href="#INSTALLDIRS">#</a>INSTALLDIRS</dt> <dd> <p>Determines which of the sets of installation directories to choose: perl, site or vendor. Defaults to site.</p> </dd> <dt id="INSTALLMAN1DIR"><a class="permalink" href="#INSTALLMAN1DIR">#</a>INSTALLMAN1DIR</dt> <dd> </dd> <dt id="INSTALLMAN3DIR"><a class="permalink" href="#INSTALLMAN3DIR">#</a>INSTALLMAN3DIR</dt> <dd> <p>These directories get the man pages at 'make install' time if INSTALLDIRS=perl. Defaults to $Config{installman*dir}.</p> <p>If set to 'none', no man pages will be installed.</p> </dd> <dt id="INSTALLPRIVLIB"><a class="permalink" href="#INSTALLPRIVLIB">#</a>INSTALLPRIVLIB</dt> <dd> <p>Used by 'make install', which copies files from INST_LIB to this directory if INSTALLDIRS is set to perl.</p> <p>Defaults to $Config{installprivlib}.</p> </dd> <dt id="INSTALLSCRIPT"><a class="permalink" href="#INSTALLSCRIPT">#</a>INSTALLSCRIPT</dt> <dd> <p>Used by 'make install' which copies files from INST_SCRIPT to this directory.</p> </dd> <dt id="INSTALLSITEARCH"><a class="permalink" href="#INSTALLSITEARCH">#</a>INSTALLSITEARCH</dt> <dd> <p>Used by 'make install', which copies files from INST_ARCHLIB to this directory if INSTALLDIRS is set to site (default).</p> </dd> <dt id="INSTALLSITEBIN"><a class="permalink" href="#INSTALLSITEBIN">#</a>INSTALLSITEBIN</dt> <dd> <p>Used by 'make install', which copies files from INST_BIN to this directory if INSTALLDIRS is set to site (default).</p> </dd> <dt id="INSTALLSITELIB"><a class="permalink" href="#INSTALLSITELIB">#</a>INSTALLSITELIB</dt> <dd> <p>Used by 'make install', which copies files from INST_LIB to this directory if INSTALLDIRS is set to site (default).</p> </dd> <dt id="INSTALLSITEMAN1DIR"><a class="permalink" href="#INSTALLSITEMAN1DIR">#</a>INSTALLSITEMAN1DIR</dt> <dd> </dd> <dt id="INSTALLSITEMAN3DIR"><a class="permalink" href="#INSTALLSITEMAN3DIR">#</a>INSTALLSITEMAN3DIR</dt> <dd> <p>These directories get the man pages at 'make install' time if INSTALLDIRS=site (default). Defaults to $(SITEPREFIX)/man/man$(MAN*EXT).</p> <p>If set to 'none', no man pages will be installed.</p> </dd> <dt id="INSTALLVENDORARCH"><a class="permalink" href="#INSTALLVENDORARCH">#</a>INSTALLVENDORARCH</dt> <dd> <p>Used by 'make install', which copies files from INST_ARCHLIB to this directory if INSTALLDIRS is set to vendor.</p> </dd> <dt id="INSTALLVENDORBIN"><a class="permalink" href="#INSTALLVENDORBIN">#</a>INSTALLVENDORBIN</dt> <dd> <p>Used by 'make install', which copies files from INST_BIN to this directory if INSTALLDIRS is set to vendor.</p> </dd> <dt id="INSTALLVENDORLIB"><a class="permalink" href="#INSTALLVENDORLIB">#</a>INSTALLVENDORLIB</dt> <dd> <p>Used by 'make install', which copies files from INST_LIB to this directory if INSTALLDIRS is set to vendor.</p> </dd> <dt id="INSTALLVENDORMAN1DIR"><a class="permalink" href="#INSTALLVENDORMAN1DIR">#</a>INSTALLVENDORMAN1DIR</dt> <dd> </dd> <dt id="INSTALLVENDORMAN3DIR"><a class="permalink" href="#INSTALLVENDORMAN3DIR">#</a>INSTALLVENDORMAN3DIR</dt> <dd> <p>These directories get the man pages at 'make install' time if INSTALLDIRS=vendor. Defaults to $(VENDORPREFIX)/man/man$(MAN*EXT).</p> <p>If set to 'none', no man pages will be installed.</p> </dd> <dt id="INST_ARCHLIB"><a class="permalink" href="#INST_ARCHLIB">#</a>INST_ARCHLIB</dt> <dd> <p>Same as INST_LIB for architecture dependent files.</p> </dd> <dt id="INST_BIN"><a class="permalink" href="#INST_BIN">#</a>INST_BIN</dt> <dd> <p>Directory to put real binary files during 'make'. These will be copied to INSTALLBIN during 'make install'</p> </dd> <dt id="INST_LIB"><a class="permalink" href="#INST_LIB">#</a>INST_LIB</dt> <dd> <p>Directory where we put library files of this extension while building it.</p> </dd> <dt id="INST_MAN1DIR"><a class="permalink" href="#INST_MAN1DIR">#</a>INST_MAN1DIR</dt> <dd> <p>Directory to hold the man pages at 'make' time</p> </dd> <dt id="INST_MAN3DIR"><a class="permalink" href="#INST_MAN3DIR">#</a>INST_MAN3DIR</dt> <dd> <p>Directory to hold the man pages at 'make' time</p> </dd> <dt id="INST_SCRIPT"><a class="permalink" href="#INST_SCRIPT">#</a>INST_SCRIPT</dt> <dd> <p>Directory, where executable files should be installed during 'make'. Defaults to "./blib/script", just to have a dummy location during testing. make install will copy the files in INST_SCRIPT to INSTALLSCRIPT.</p> </dd> <dt id="LD"><a class="permalink" href="#LD">#</a>LD</dt> <dd> <p>Program to be used to link libraries for dynamic loading.</p> <p>Defaults to $Config{ld}.</p> </dd> <dt id="LDDLFLAGS"><a class="permalink" href="#LDDLFLAGS">#</a>LDDLFLAGS</dt> <dd> <p>Any special flags that might need to be passed to ld to create a shared library suitable for dynamic loading. It is up to the makefile to use it. (See <a href="/5.6.2/Config#lddlflags">"lddlflags" in Config</a>)</p> <p>Defaults to $Config{lddlflags}.</p> </dd> <dt id="LDFROM"><a class="permalink" href="#LDFROM">#</a>LDFROM</dt> <dd> <p>Defaults to "$(OBJECT)" and is used in the ld command to specify what files to link/load from (also see dynamic_lib below for how to specify ld flags)</p> </dd> <dt id="LIB"><a class="permalink" href="#LIB">#</a>LIB</dt> <dd> <p>LIB should only be set at <code>perl Makefile.PL</code> time but is allowed as a MakeMaker argument. It has the effect of setting both INSTALLPRIVLIB and INSTALLSITELIB to that value regardless any explicit setting of those arguments (or of PREFIX). INSTALLARCHLIB and INSTALLSITEARCH are set to the corresponding architecture subdirectory.</p> </dd> <dt id="LIBPERL_A"><a class="permalink" href="#LIBPERL_A">#</a>LIBPERL_A</dt> <dd> <p>The filename of the perllibrary that will be used together with this extension. Defaults to libperl.a.</p> </dd> <dt id="LIBS"><a class="permalink" href="#LIBS">#</a>LIBS</dt> <dd> <p>An anonymous array of alternative library specifications to be searched for (in order) until at least one library is found. E.g.</p> <pre><code class="plaintext">'LIBS' => ["-lgdbm", "-ldbm -lfoo", "-L/path -ldbm.nfs"]</code></pre> <p>Mind, that any element of the array contains a complete set of arguments for the ld command. So do not specify</p> <pre><code class="plaintext">'LIBS' => ["-ltcl", "-ltk", "-lX11"]</code></pre> <p>See ODBM_File/Makefile.PL for an example, where an array is needed. If you specify a scalar as in</p> <pre><code class="plaintext">'LIBS' => "-ltcl -ltk -lX11"</code></pre> <p>MakeMaker will turn it into an array with one element.</p> </dd> <dt id="LINKTYPE"><a class="permalink" href="#LINKTYPE">#</a>LINKTYPE</dt> <dd> <p>'static' or 'dynamic' (default unless usedl=undef in config.sh). Should only be used to force static linking (also see linkext below).</p> </dd> <dt id="MAKEAPERL"><a class="permalink" href="#MAKEAPERL">#</a>MAKEAPERL</dt> <dd> <p>Boolean which tells MakeMaker, that it should include the rules to make a perl. This is handled automatically as a switch by MakeMaker. The user normally does not need it.</p> </dd> <dt id="MAKEFILE_OLD"><a class="permalink" href="#MAKEFILE_OLD">#</a>MAKEFILE_OLD</dt> <dd> <p>When 'make clean' or similar is run, the $(FIRST_MAKEFILE) will be backed up at this location.</p> <p>Defaults to $(FIRST_MAKEFILE).old or $(FIRST_MAKEFILE)_old on VMS.</p> </dd> <dt id="MAN1PODS"><a class="permalink" href="#MAN1PODS">#</a>MAN1PODS</dt> <dd> <p>Hashref of pod-containing files. MakeMaker will default this to all EXE_FILES files that include POD directives. The files listed here will be converted to man pages and installed as was requested at Configure time.</p> </dd> <dt id="MAN3PODS"><a class="permalink" href="#MAN3PODS">#</a>MAN3PODS</dt> <dd> <p>Hashref that assigns to *.pm and *.pod files the files into which the manpages are to be written. MakeMaker parses all *.pod and *.pm files for POD directives. Files that contain POD will be the default keys of the MAN3PODS hashref. These will then be converted to man pages during <code>make</code> and will be installed during <code>make install</code>.</p> </dd> <dt id="MAP_TARGET"><a class="permalink" href="#MAP_TARGET">#</a>MAP_TARGET</dt> <dd> <p>If it is intended, that a new perl binary be produced, this variable may hold a name for that binary. Defaults to perl</p> </dd> <dt id="MYEXTLIB"><a class="permalink" href="#MYEXTLIB">#</a>MYEXTLIB</dt> <dd> <p>If the extension links to a library that it builds set this to the name of the library (see SDBM_File)</p> </dd> <dt id="NAME1"><a class="permalink" href="#NAME1">#</a>NAME</dt> <dd> <p>Perl module name for this extension (DBD::Oracle). This will default to the directory name but should be explicitly defined in the Makefile.PL.</p> </dd> <dt id="NEEDS_LINKING"><a class="permalink" href="#NEEDS_LINKING">#</a>NEEDS_LINKING</dt> <dd> <p>MakeMaker will figure out if an extension contains linkable code anywhere down the directory tree, and will set this variable accordingly, but you can speed it up a very little bit if you define this boolean variable yourself.</p> </dd> <dt id="NOECHO"><a class="permalink" href="#NOECHO">#</a>NOECHO</dt> <dd> <p>Command so make does not print the literal commands its running.</p> <p>By setting it to an empty string you can generate a Makefile that prints all commands. Mainly used in debugging MakeMaker itself.</p> <p>Defaults to <code>@</code>.</p> </dd> <dt id="NORECURS"><a class="permalink" href="#NORECURS">#</a>NORECURS</dt> <dd> <p>Boolean. Attribute to inhibit descending into subdirectories.</p> </dd> <dt id="NO_META"><a class="permalink" href="#NO_META">#</a>NO_META</dt> <dd> <p>When true, suppresses the generation and addition to the MANIFEST of the META.yml module meta-data file during 'make distdir'.</p> <p>Defaults to false.</p> </dd> <dt id="NO_VC"><a class="permalink" href="#NO_VC">#</a>NO_VC</dt> <dd> <p>In general, any generated Makefile checks for the current version of MakeMaker and the version the Makefile was built under. If NO_VC is set, the version check is neglected. Do not write this into your Makefile.PL, use it interactively instead.</p> </dd> <dt id="OBJECT"><a class="permalink" href="#OBJECT">#</a>OBJECT</dt> <dd> <p>List of object files, defaults to '$(BASEEXT)$(OBJ_EXT)', but can be a long string containing all object files, e.g. "tkpBind.o tkpButton.o tkpCanvas.o"</p> <p>(Where BASEEXT is the last component of NAME, and OBJ_EXT is $Config{obj_ext}.)</p> </dd> <dt id="OPTIMIZE"><a class="permalink" href="#OPTIMIZE">#</a>OPTIMIZE</dt> <dd> <p>Defaults to <code>-O</code>. Set it to <code>-g</code> to turn debugging on. The flag is passed to subdirectory makes.</p> </dd> <dt id="PERL"><a class="permalink" href="#PERL">#</a>PERL</dt> <dd> <p>Perl binary for tasks that can be done by miniperl</p> </dd> <dt id="PERL_CORE"><a class="permalink" href="#PERL_CORE">#</a>PERL_CORE</dt> <dd> <p>Set only when MakeMaker is building the extensions of the Perl core distribution.</p> </dd> <dt id="PERLMAINCC"><a class="permalink" href="#PERLMAINCC">#</a>PERLMAINCC</dt> <dd> <p>The call to the program that is able to compile perlmain.c. Defaults to $(CC).</p> </dd> <dt id="PERL_ARCHLIB"><a class="permalink" href="#PERL_ARCHLIB">#</a>PERL_ARCHLIB</dt> <dd> <p>Same as for PERL_LIB, but for architecture dependent files.</p> <p>Used only when MakeMaker is building the extensions of the Perl core distribution (because normally $(PERL_ARCHLIB) is automatically in @INC, and adding it would get in the way of PERL5LIB).</p> </dd> <dt id="PERL_LIB"><a class="permalink" href="#PERL_LIB">#</a>PERL_LIB</dt> <dd> <p>Directory containing the Perl library to use.</p> <p>Used only when MakeMaker is building the extensions of the Perl core distribution (because normally $(PERL_LIB) is automatically in @INC, and adding it would get in the way of PERL5LIB).</p> </dd> <dt id="PERL_MALLOC_OK"><a class="permalink" href="#PERL_MALLOC_OK">#</a>PERL_MALLOC_OK</dt> <dd> <p>defaults to 0. Should be set to TRUE if the extension can work with the memory allocation routines substituted by the Perl malloc() subsystem. This should be applicable to most extensions with exceptions of those</p> <ul> <li><p>with bugs in memory allocations which are caught by Perl's malloc();</p> </li> <li><p>which interact with the memory allocator in other ways than via malloc(), realloc(), free(), calloc(), sbrk() and brk();</p> </li> <li><p>which rely on special alignment which is not provided by Perl's malloc().</p> </li> </ul> <p><b>NOTE.</b> Negligence to set this flag in <i>any one</i> of loaded extension nullifies many advantages of Perl's malloc(), such as better usage of system resources, error detection, memory usage reporting, catchable failure of memory allocations, etc.</p> </dd> <dt id="PERLPREFIX"><a class="permalink" href="#PERLPREFIX">#</a>PERLPREFIX</dt> <dd> <p>Directory under which core modules are to be installed.</p> <p>Defaults to $Config{installprefixexp} falling back to $Config{installprefix}, $Config{prefixexp} or $Config{prefix} should $Config{installprefixexp} not exist.</p> <p>Overridden by PREFIX.</p> </dd> <dt id="PERLRUN"><a class="permalink" href="#PERLRUN">#</a>PERLRUN</dt> <dd> <p>Use this instead of $(PERL) when you wish to run perl. It will set up extra necessary flags for you.</p> </dd> <dt id="PERLRUNINST"><a class="permalink" href="#PERLRUNINST">#</a>PERLRUNINST</dt> <dd> <p>Use this instead of $(PERL) when you wish to run perl to work with modules. It will add things like -I$(INST_ARCH) and other necessary flags so perl can see the modules you're about to install.</p> </dd> <dt id="PERL_SRC"><a class="permalink" href="#PERL_SRC">#</a>PERL_SRC</dt> <dd> <p>Directory containing the Perl source code (use of this should be avoided, it may be undefined)</p> </dd> <dt id="PERM_RW"><a class="permalink" href="#PERM_RW">#</a>PERM_RW</dt> <dd> <p>Desired permission for read/writable files. Defaults to <code>644</code>. See also <a href="/5.6.2/MM_Unix#perm_rw">"perm_rw" in MM_Unix</a>.</p> </dd> <dt id="PERM_RWX"><a class="permalink" href="#PERM_RWX">#</a>PERM_RWX</dt> <dd> <p>Desired permission for executable files. Defaults to <code>755</code>. See also <a href="/5.6.2/MM_Unix#perm_rwx">"perm_rwx" in MM_Unix</a>.</p> </dd> <dt id="PL_FILES"><a class="permalink" href="#PL_FILES">#</a>PL_FILES</dt> <dd> <p>Ref to hash of files to be processed as perl programs. MakeMaker will default to any found *.PL file (except Makefile.PL) being keys and the basename of the file being the value. E.g.</p> <pre><code class="plaintext">{'foobar.PL' => 'foobar'}</code></pre> <p>The *.PL files are expected to produce output to the target files themselves. If multiple files can be generated from the same *.PL file then the value in the hash can be a reference to an array of target file names. E.g.</p> <pre><code class="plaintext">{'foobar.PL' => ['foobar1','foobar2']}</code></pre> </dd> <dt id="PM"><a class="permalink" href="#PM">#</a>PM</dt> <dd> <p>Hashref of .pm files and *.pl files to be installed. e.g.</p> <pre><code class="plaintext">{'name_of_file.pm' => '$(INST_LIBDIR)/install_as.pm'}</code></pre> <p>By default this will include *.pm and *.pl and the files found in the PMLIBDIRS directories. Defining PM in the Makefile.PL will override PMLIBDIRS.</p> </dd> <dt id="PMLIBDIRS"><a class="permalink" href="#PMLIBDIRS">#</a>PMLIBDIRS</dt> <dd> <p>Ref to array of subdirectories containing library files. Defaults to [ 'lib', $(BASEEXT) ]. The directories will be scanned and <i>any</i> files they contain will be installed in the corresponding location in the library. A libscan() method can be used to alter the behaviour. Defining PM in the Makefile.PL will override PMLIBDIRS.</p> <p>(Where BASEEXT is the last component of NAME.)</p> </dd> <dt id="PM_FILTER"><a class="permalink" href="#PM_FILTER">#</a>PM_FILTER</dt> <dd> <p>A filter program, in the traditional Unix sense (input from stdin, output to stdout) that is passed on each .pm file during the build (in the pm_to_blib() phase). It is empty by default, meaning no filtering is done.</p> <p>Great care is necessary when defining the command if quoting needs to be done. For instance, you would need to say:</p> <pre><code class="plaintext">{'PM_FILTER' => 'grep -v \\"^\\#\\"'}</code></pre> <p>to remove all the leading coments on the fly during the build. The extra \\ are necessary, unfortunately, because this variable is interpolated within the context of a Perl program built on the command line, and double quotes are what is used with the -e switch to build that command line. The # is escaped for the Makefile, since what is going to be generated will then be:</p> <pre><code class="plaintext">PM_FILTER = grep -v \"^\#\"</code></pre> <p>Without the \\ before the #, we'd have the start of a Makefile comment, and the macro would be incorrectly defined.</p> </dd> <dt id="POLLUTE"><a class="permalink" href="#POLLUTE">#</a>POLLUTE</dt> <dd> <p>Release 5.005 grandfathered old global symbol names by providing preprocessor macros for extension source compatibility. As of release 5.6, these preprocessor definitions are not available by default. The POLLUTE flag specifies that the old names should still be defined:</p> <pre><code class="plaintext">perl Makefile.PL POLLUTE=1</code></pre> <p>Please inform the module author if this is necessary to successfully install a module under 5.6 or later.</p> </dd> <dt id="PPM_INSTALL_EXEC"><a class="permalink" href="#PPM_INSTALL_EXEC">#</a>PPM_INSTALL_EXEC</dt> <dd> <p>Name of the executable used to run <code>PPM_INSTALL_SCRIPT</code> below. (e.g. perl)</p> </dd> <dt id="PPM_INSTALL_SCRIPT"><a class="permalink" href="#PPM_INSTALL_SCRIPT">#</a>PPM_INSTALL_SCRIPT</dt> <dd> <p>Name of the script that gets executed by the Perl Package Manager after the installation of a package.</p> </dd> <dt id="PREFIX"><a class="permalink" href="#PREFIX">#</a>PREFIX</dt> <dd> <p>This overrides all the default install locations. Man pages, libraries, scripts, etc... MakeMaker will try to make an educated guess about where to place things under the new PREFIX based on your Config defaults. Failing that, it will fall back to a structure which should be sensible for your platform.</p> <p>If you specify LIB or any INSTALL* variables they will not be effected by the PREFIX.</p> </dd> <dt id="PREREQ_FATAL"><a class="permalink" href="#PREREQ_FATAL">#</a>PREREQ_FATAL</dt> <dd> <p>Bool. If this parameter is true, failing to have the required modules (or the right versions thereof) will be fatal. perl Makefile.PL will die with the proper message.</p> <p>Note: see <a href="/5.6.2/Test::Harness">Test::Harness</a> for a shortcut for stopping tests early if you are missing dependencies.</p> <p>Do <i>not</i> use this parameter for simple requirements, which could be resolved at a later time, e.g. after an unsuccessful <b>make test</b> of your module.</p> <p>It is <i>extremely</i> rare to have to use <code>PREREQ_FATAL</code> at all!</p> </dd> <dt id="PREREQ_PM"><a class="permalink" href="#PREREQ_PM">#</a>PREREQ_PM</dt> <dd> <p>Hashref: Names of modules that need to be available to run this extension (e.g. Fcntl for SDBM_File) are the keys of the hash and the desired version is the value. If the required version number is 0, we only check if any version is installed already.</p> </dd> <dt id="PREREQ_PRINT"><a class="permalink" href="#PREREQ_PRINT">#</a>PREREQ_PRINT</dt> <dd> <p>Bool. If this parameter is true, the prerequisites will be printed to stdout and MakeMaker will exit. The output format is an evalable hash ref.</p> <p>$PREREQ_PM = { 'A::B' => Vers1, 'C::D' => Vers2, ... };</p> </dd> <dt id="PRINT_PREREQ"><a class="permalink" href="#PRINT_PREREQ">#</a>PRINT_PREREQ</dt> <dd> <p>RedHatism for <code>PREREQ_PRINT</code>. The output format is different, though:</p> <pre><code class="plaintext">perl(A::B)>=Vers1 perl(C::D)>=Vers2 ...</code></pre> </dd> <dt id="SITEPREFIX"><a class="permalink" href="#SITEPREFIX">#</a>SITEPREFIX</dt> <dd> <p>Like PERLPREFIX, but only for the site install locations.</p> <p>Defaults to $Config{siteprefixexp}. Perls prior to 5.6.0 didn't have an explicit siteprefix in the Config. In those cases $Config{installprefix} will be used.</p> <p>Overridable by PREFIX</p> </dd> <dt id="SKIP"><a class="permalink" href="#SKIP">#</a>SKIP</dt> <dd> <p>Arrayref. E.g. [qw(name1 name2)] skip (do not write) sections of the Makefile. Caution! Do not use the SKIP attribute for the negligible speedup. It may seriously damage the resulting Makefile. Only use it if you really need it.</p> </dd> <dt id="TYPEMAPS"><a class="permalink" href="#TYPEMAPS">#</a>TYPEMAPS</dt> <dd> <p>Ref to array of typemap file names. Use this when the typemaps are in some directory other than the current directory or when they are not named <b>typemap</b>. The last typemap in the list takes precedence. A typemap in the current directory has highest precedence, even if it isn't listed in TYPEMAPS. The default system typemap has lowest precedence.</p> </dd> <dt id="VENDORPREFIX"><a class="permalink" href="#VENDORPREFIX">#</a>VENDORPREFIX</dt> <dd> <p>Like PERLPREFIX, but only for the vendor install locations.</p> <p>Defaults to $Config{vendorprefixexp}.</p> <p>Overridable by PREFIX</p> </dd> <dt id="VERBINST"><a class="permalink" href="#VERBINST">#</a>VERBINST</dt> <dd> <p>If true, make install will be verbose</p> </dd> <dt id="VERSION"><a class="permalink" href="#VERSION">#</a>VERSION</dt> <dd> <p>Your version number for distributing the package. This defaults to 0.1.</p> </dd> <dt id="VERSION_FROM"><a class="permalink" href="#VERSION_FROM">#</a>VERSION_FROM</dt> <dd> <p>Instead of specifying the VERSION in the Makefile.PL you can let MakeMaker parse a file to determine the version number. The parsing routine requires that the file named by VERSION_FROM contains one single line to compute the version number. The first line in the file that contains the regular expression</p> <pre><code class="plaintext">/([\$*])(([\w\:\']*)\bVERSION)\b.*\=/</code></pre> <p>will be evaluated with eval() and the value of the named variable <b>after</b> the eval() will be assigned to the VERSION attribute of the MakeMaker object. The following lines will be parsed o.k.:</p> <pre><code>$VERSION = '1.00'; *VERSION = \'1.01'; $VERSION = sprintf "%d.%03d", q$Revision: 1.133 $ =~ /(\d+)/g; $FOO::VERSION = '1.10'; *FOO::VERSION = \'1.11'; our $VERSION = 1.2.3; # new for perl5.6.0 </code></pre> <p>but these will fail:</p> <pre><code>my $VERSION = '1.01'; local $VERSION = '1.02'; local $FOO::VERSION = '1.30';</code></pre> <p>(Putting <code>my</code> or <code>local</code> on the preceding line will work o.k.)</p> <p>The file named in VERSION_FROM is not added as a dependency to Makefile. This is not really correct, but it would be a major pain during development to have to rewrite the Makefile for any smallish change in that file. If you want to make sure that the Makefile contains the correct VERSION macro after any change of the file, you would have to do something like</p> <pre><code class="plaintext">depend => { Makefile => '$(VERSION_FROM)' }</code></pre> <p>See attribute <code>depend</code> below.</p> </dd> <dt id="VERSION_SYM"><a class="permalink" href="#VERSION_SYM">#</a>VERSION_SYM</dt> <dd> <p>A sanitized VERSION with . replaced by _. For places where . has special meaning (some filesystems, RCS labels, etc...)</p> </dd> <dt id="XS"><a class="permalink" href="#XS">#</a>XS</dt> <dd> <p>Hashref of .xs files. MakeMaker will default this. e.g.</p> <pre><code class="plaintext">{'name_of_file.xs' => 'name_of_file.c'}</code></pre> <p>The .c files will automatically be included in the list of files deleted by a make clean.</p> </dd> <dt id="XSOPT"><a class="permalink" href="#XSOPT">#</a>XSOPT</dt> <dd> <p>String of options to pass to xsubpp. This might include <code>-C++</code> or <code>-extern</code>. Do not include typemaps here; the TYPEMAP parameter exists for that purpose.</p> </dd> <dt id="XSPROTOARG"><a class="permalink" href="#XSPROTOARG">#</a>XSPROTOARG</dt> <dd> <p>May be set to an empty string, which is identical to <code>-prototypes</code>, or <code>-noprototypes</code>. See the xsubpp documentation for details. MakeMaker defaults to the empty string.</p> </dd> <dt id="XS_VERSION"><a class="permalink" href="#XS_VERSION">#</a>XS_VERSION</dt> <dd> <p>Your version number for the .xs file of this package. This defaults to the value of the VERSION attribute.</p> </dd> </dl> <h2 id="Additional-lowercase-attributes"><a class="permalink" href="#Additional-lowercase-attributes">#</a><a id="Additional"></a>Additional lowercase attributes</h2> <p>can be used to pass parameters to the methods which implement that part of the Makefile. Parameters are specified as a hash ref but are passed to the method as a hash.</p> <dl> <dt id="clean"><a class="permalink" href="#clean">#</a>clean</dt> <dd> <pre><code class="plaintext">{FILES => "*.xyz foo"}</code></pre> </dd> <dt id="depend"><a class="permalink" href="#depend">#</a>depend</dt> <dd> <pre><code class="plaintext">{ANY_TARGET => ANY_DEPENDECY, ...}</code></pre> <p>(ANY_TARGET must not be given a double-colon rule by MakeMaker.)</p> </dd> <dt id="dist"><a class="permalink" href="#dist">#</a>dist</dt> <dd> <pre><code class="plaintext">{TARFLAGS => 'cvfF', COMPRESS => 'gzip', SUFFIX => '.gz', SHAR => 'shar -m', DIST_CP => 'ln', ZIP => '/bin/zip', ZIPFLAGS => '-rl', DIST_DEFAULT => 'private tardist' }</code></pre> <p>If you specify COMPRESS, then SUFFIX should also be altered, as it is needed to tell make the target file of the compression. Setting DIST_CP to ln can be useful, if you need to preserve the timestamps on your files. DIST_CP can take the values 'cp', which copies the file, 'ln', which links the file, and 'best' which copies symbolic links and links the rest. Default is 'best'.</p> </dd> <dt id="dynamic_lib"><a class="permalink" href="#dynamic_lib">#</a>dynamic_lib</dt> <dd> <pre><code class="plaintext">{ARMAYBE => 'ar', OTHERLDFLAGS => '...', INST_DYNAMIC_DEP => '...'}</code></pre> </dd> <dt id="linkext"><a class="permalink" href="#linkext">#</a>linkext</dt> <dd> <pre><code class="plaintext">{LINKTYPE => 'static', 'dynamic' or ''}</code></pre> <p>NB: Extensions that have nothing but *.pm files had to say</p> <pre><code class="plaintext">{LINKTYPE => ''}</code></pre> <p>with Pre-5.0 MakeMakers. Since version 5.00 of MakeMaker such a line can be deleted safely. MakeMaker recognizes when there's nothing to be linked.</p> </dd> <dt id="macro"><a class="permalink" href="#macro">#</a>macro</dt> <dd> <pre><code class="plaintext">{ANY_MACRO => ANY_VALUE, ...}</code></pre> </dd> <dt id="postamble"><a class="permalink" href="#postamble">#</a>postamble</dt> <dd> <p>Anything put here will be passed to MY::postamble() if you have one.</p> </dd> <dt id="realclean"><a class="permalink" href="#realclean">#</a>realclean</dt> <dd> <pre><code class="plaintext">{FILES => '$(INST_ARCHAUTODIR)/*.xyz'}</code></pre> </dd> <dt id="test"><a class="permalink" href="#test">#</a>test</dt> <dd> <pre><code class="plaintext">{TESTS => 't/*.t'}</code></pre> </dd> <dt id="tool_autosplit"><a class="permalink" href="#tool_autosplit">#</a>tool_autosplit</dt> <dd> <pre><code class="plaintext">{MAXLEN => 8}</code></pre> </dd> </dl> <h2 id="Overriding-MakeMaker-Methods"><a class="permalink" href="#Overriding-MakeMaker-Methods">#</a><a id="Overriding"></a>Overriding MakeMaker Methods</h2> <p>If you cannot achieve the desired Makefile behaviour by specifying attributes you may define private subroutines in the Makefile.PL. Each subroutine returns the text it wishes to have written to the Makefile. To override a section of the Makefile you can either say:</p> <pre><code class="plaintext">sub MY::c_o { "new literal text" }</code></pre> <p>or you can edit the default by saying something like:</p> <pre><code>package MY; # so that "SUPER" works right sub c_o { my $inherited = shift->SUPER::c_o(@_); $inherited =~ s/old text/new text/; $inherited; }</code></pre> <p>If you are running experiments with embedding perl as a library into other applications, you might find MakeMaker is not sufficient. You'd better have a look at ExtUtils::Embed which is a collection of utilities for embedding.</p> <p>If you still need a different solution, try to develop another subroutine that fits your needs and submit the diffs to <i>makemaker@perl.org</i></p> <p>For a complete description of all MakeMaker methods see <a href="/5.6.2/ExtUtils::MM_Unix">ExtUtils::MM_Unix</a>.</p> <p>Here is a simple example of how to add a new target to the generated Makefile:</p> <pre><code>sub MY::postamble { return <<'MAKE_FRAG'; $(MYEXTLIB): sdbm/Makefile cd sdbm && $(MAKE) all MAKE_FRAG }</code></pre> <h2 id="The-End-Of-Cargo-Cult-Programming"><a class="permalink" href="#The-End-Of-Cargo-Cult-Programming">#</a><a id="The"></a>The End Of Cargo Cult Programming</h2> <p>WriteMakefile() now does some basic sanity checks on its parameters to protect against typos and malformatted values. This means some things which happened to work in the past will now throw warnings and possibly produce internal errors.</p> <p>Some of the most common mistakes:</p> <dl> <dt id="<MAN3PODS-=-'-'>>"><a class="permalink" href="#%3CMAN3PODS-=-'-'%3E%3E">#</a><a id="MAN3PODS1"></a><code><MAN3PODS =</code> ' '>></dt> <dd> <p>This is commonly used to supress the creation of man pages. MAN3PODS takes a hash ref not a string, but the above worked by accident in old versions of MakeMaker.</p> <p>The correct code is <code><MAN3PODS =</code> { }>>.</p> </dd> </dl> <h2 id="Hintsfile-support"><a class="permalink" href="#Hintsfile-support">#</a><a id="Hintsfile"></a>Hintsfile support</h2> <p>MakeMaker.pm uses the architecture specific information from Config.pm. In addition it evaluates architecture specific hints files in a <code>hints/</code> directory. The hints files are expected to be named like their counterparts in <code>PERL_SRC/hints</code>, but with an <code>.pl</code> file name extension (eg. <code>next_3_2.pl</code>). They are simply <code>eval</code>ed by MakeMaker within the WriteMakefile() subroutine, and can be used to execute commands as well as to include special variables. The rules which hintsfile is chosen are the same as in Configure.</p> <p>The hintsfile is eval()ed immediately after the arguments given to WriteMakefile are stuffed into a hash reference $self but before this reference becomes blessed. So if you want to do the equivalent to override or create an attribute you would say something like</p> <pre><code>$self->{LIBS} = ['-ldbm -lucb -lc'];</code></pre> <h2 id="Distribution-Support"><a class="permalink" href="#Distribution-Support">#</a><a id="Distribution"></a>Distribution Support</h2> <p>For authors of extensions MakeMaker provides several Makefile targets. Most of the support comes from the ExtUtils::Manifest module, where additional documentation can be found.</p> <dl> <dt id="make-distcheck"><a class="permalink" href="#make-distcheck">#</a><a id="make3"></a>make distcheck</dt> <dd> <p>reports which files are below the build directory but not in the MANIFEST file and vice versa. (See ExtUtils::Manifest::fullcheck() for details)</p> </dd> <dt id="make-skipcheck"><a class="permalink" href="#make-skipcheck">#</a><a id="make4"></a>make skipcheck</dt> <dd> <p>reports which files are skipped due to the entries in the <code>MANIFEST.SKIP</code> file (See ExtUtils::Manifest::skipcheck() for details)</p> </dd> <dt id="make-distclean"><a class="permalink" href="#make-distclean">#</a><a id="make5"></a>make distclean</dt> <dd> <p>does a realclean first and then the distcheck. Note that this is not needed to build a new distribution as long as you are sure that the MANIFEST file is ok.</p> </dd> <dt id="make-manifest"><a class="permalink" href="#make-manifest">#</a><a id="make6"></a>make manifest</dt> <dd> <p>rewrites the MANIFEST file, adding all remaining files found (See ExtUtils::Manifest::mkmanifest() for details)</p> </dd> <dt id="make-distdir"><a class="permalink" href="#make-distdir">#</a><a id="make7"></a>make distdir</dt> <dd> <p>Copies all the files that are in the MANIFEST file to a newly created directory with the name <code>$(DISTNAME)-$(VERSION)</code>. If that directory exists, it will be removed first.</p> <p>Additionally, it will create a META.yml module meta-data file and add this to your MANFIEST. You can shut this behavior off with the NO_META flag.</p> </dd> <dt id="make-disttest"><a class="permalink" href="#make-disttest">#</a><a id="make8"></a>make disttest</dt> <dd> <p>Makes a distdir first, and runs a <code>perl Makefile.PL</code>, a make, and a make test in that directory.</p> </dd> <dt id="make-tardist"><a class="permalink" href="#make-tardist">#</a><a id="make9"></a>make tardist</dt> <dd> <p>First does a distdir. Then a command $(PREOP) which defaults to a null command, followed by $(TOUNIX), which defaults to a null command under UNIX, and will convert files in distribution directory to UNIX format otherwise. Next it runs <code>tar</code> on that directory into a tarfile and deletes the directory. Finishes with a command $(POSTOP) which defaults to a null command.</p> </dd> <dt id="make-dist"><a class="permalink" href="#make-dist">#</a><a id="make10"></a>make dist</dt> <dd> <p>Defaults to $(DIST_DEFAULT) which in turn defaults to tardist.</p> </dd> <dt id="make-uutardist"><a class="permalink" href="#make-uutardist">#</a><a id="make11"></a>make uutardist</dt> <dd> <p>Runs a tardist first and uuencodes the tarfile.</p> </dd> <dt id="make-shdist"><a class="permalink" href="#make-shdist">#</a><a id="make12"></a>make shdist</dt> <dd> <p>First does a distdir. Then a command $(PREOP) which defaults to a null command. Next it runs <code>shar</code> on that directory into a sharfile and deletes the intermediate directory again. Finishes with a command $(POSTOP) which defaults to a null command. Note: For shdist to work properly a <code>shar</code> program that can handle directories is mandatory.</p> </dd> <dt id="make-zipdist"><a class="permalink" href="#make-zipdist">#</a><a id="make13"></a>make zipdist</dt> <dd> <p>First does a distdir. Then a command $(PREOP) which defaults to a null command. Runs <code>$(ZIP) $(ZIPFLAGS)</code> on that directory into a zipfile. Then deletes that directory. Finishes with a command $(POSTOP) which defaults to a null command.</p> </dd> <dt id="make-ci"><a class="permalink" href="#make-ci">#</a><a id="make14"></a>make ci</dt> <dd> <p>Does a $(CI) and a $(RCS_LABEL) on all files in the MANIFEST file.</p> </dd> </dl> <p>Customization of the dist targets can be done by specifying a hash reference to the dist attribute of the WriteMakefile call. The following parameters are recognized:</p> <pre><code class="plaintext">CI ('ci -u') COMPRESS ('gzip --best') POSTOP ('@ :') PREOP ('@ :') TO_UNIX (depends on the system) RCS_LABEL ('rcs -q -Nv$(VERSION_SYM):') SHAR ('shar') SUFFIX ('.gz') TAR ('tar') TARFLAGS ('cvf') ZIP ('zip') ZIPFLAGS ('-r')</code></pre> <p>An example:</p> <pre><code class="plaintext">WriteMakefile( 'dist' => { COMPRESS=>"bzip2", SUFFIX=>".bz2" })</code></pre> <h2 id="Module-Meta-Data"><a class="permalink" href="#Module-Meta-Data">#</a><a id="Module"></a>Module Meta-Data</h2> <p>Long plaguing users of MakeMaker based modules has been the problem of getting basic information about the module out of the sources <i>without</i> running the <i>Makefile.PL</i> and doing a bunch of messy heuristics on the resulting <i>Makefile</i>. To this end a simple module meta-data file has been introduced, <i>META.yml</i>.</p> <p><i>META.yml</i> is a YAML document (see http://www.yaml.org) containing basic information about the module (name, version, prerequisites...) in an easy to read format. The format is developed and defined by the Module::Build developers (see http://module-build.sourceforge.net/META-spec.html)</p> <p>MakeMaker will automatically generate a <i>META.yml</i> file for you and add it to your <i>MANIFEST</i> as part of the 'distdir' target (and thus the 'dist' target). This is intended to seamlessly and rapidly populate CPAN with module meta-data. If you wish to shut this feature off, set the <code>NO_META</code> <code>WriteMakefile()</code> flag to true.</p> <h2 id="Disabling-an-extension"><a class="permalink" href="#Disabling-an-extension">#</a><a id="Disabling"></a>Disabling an extension</h2> <p>If some events detected in <i>Makefile.PL</i> imply that there is no way to create the Module, but this is a normal state of things, then you can create a <i>Makefile</i> which does nothing, but succeeds on all the "usual" build targets. To do so, use</p> <pre><code>ExtUtils::MakeMaker::WriteEmptyMakefile();</code></pre> <p>instead of WriteMakefile().</p> <p>This may be useful if other modules expect this module to be <i>built</i> OK, as opposed to <i>work</i> OK (say, this system-dependent module builds in a subdirectory of some other distribution, or is listed as a dependency in a CPAN::Bundle, but the functionality is supported by different means on the current architecture).</p> <h2 id="Other-Handy-Functions"><a class="permalink" href="#Other-Handy-Functions">#</a><a id="Other"></a>Other Handy Functions</h2> <dl> <dt id="prompt"><a class="permalink" href="#prompt">#</a>prompt</dt> <dd> <pre><code>my $value = prompt($message); my $value = prompt($message, $default);</code></pre> <p>The <code>prompt()</code> function provides an easy way to request user input used to write a makefile. It displays the $message as a prompt for input. If a $default is provided it will be used as a default. The function returns the $value selected by the user.</p> <p>If <code>prompt()</code> detects that it is not running interactively and there is nothing on STDIN or if the PERL_MM_USE_DEFAULT environment variable is set to true, the $default will be used without prompting. This prevents automated processes from blocking on user input.</p> <p>If no $default is provided an empty string will be used instead.</p> </dd> </dl> <h1 id="ENVIRONMENT"><a class="permalink" href="#ENVIRONMENT">#</a>ENVIRONMENT</h1> <dl> <dt id="PERL_MM_OPT"><a class="permalink" href="#PERL_MM_OPT">#</a>PERL_MM_OPT</dt> <dd> <p>Command line options used by <code>MakeMaker->new()</code>, and thus by <code>WriteMakefile()</code>. The string is split on whitespace, and the result is processed before any actual command line arguments are processed.</p> </dd> <dt id="PERL_MM_USE_DEFAULT"><a class="permalink" href="#PERL_MM_USE_DEFAULT">#</a>PERL_MM_USE_DEFAULT</dt> <dd> <p>If set to a true value then MakeMaker's prompt function will always return the default without waiting for user input.</p> </dd> </dl> <h1 id="SEE-ALSO"><a class="permalink" href="#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1> <p>ExtUtils::MM_Unix, ExtUtils::Manifest ExtUtils::Install, ExtUtils::Embed</p> <h1 id="AUTHORS"><a class="permalink" href="#AUTHORS">#</a>AUTHORS</h1> <p>Andy Dougherty <<i>doughera@lafayette.edu</i>>, Andreas K枚nig <<i>andreas.koenig@mind.de</i>>, Tim Bunce <<i>timb@cpan.org</i>>. VMS support by Charles Bailey <<i>bailey@newman.upenn.edu</i>>. OS/2 support by Ilya Zakharevich <<i>ilya@math.ohio-state.edu</i>>.</p> <p>Currently maintained by Michael G Schwern <<i>schwern@pobox.com</i>></p> <p>Send patches and ideas to <<i>makemaker@perl.org</i>>.</p> <p>Send bug reports via http://rt.cpan.org/. Please send your generated Makefile along with your report.</p> <p>For more up-to-date information, see http://www.makemaker.org.</p> <h1 id="LICENSE"><a class="permalink" href="#LICENSE">#</a>LICENSE</h1> <p>This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p> <p>See <i>http://www.perl.com/perl/misc/Artistic.html</i></p> </div> <div id="footer"> <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p> <p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p> </div> </div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> <script src="/js/highlight.pack.js"></script> <script>hljs.highlightAll();</script> </body> </html>