NAME

make - tools for making makefiles with.

SYNOPSIS

  use constant MOD_REQS =>
    [
     { name    => 'Pod::Usage',
       version => '1.12', },

     { name    => 'IPC::Run',
       package => 'IPC-Run',
       version => '0.44', },

     { name     => 'DBI::Wrap',
       package  => 'DBI-Wrap',
       version  => '1.00',
       optional => 1, },
    ];

  use constant EXEC_REQS =>
    [
     { name    => 'blastpgp',
       version => '1.50',
       vopt    => '--version', },

     { name    => 'mkprofile', },

     { name    => 'mp3id',
       version => '0.4',
       vopt    => '--help',
       vexpect => 255, },
    ];

  use constant NAME         => 'Module-Name';
  use constant VERSION_FROM => catfile (qw( lib Module Name.pm ));
  use constant AUTHOR       => 'Martyn J. Pearce fluffy@cpan.org';
  use constant ABSTRACT     => 'This module makes chocolate biscuits';

  use make.pm

DESCRIPTION

This package provides methods and initialization to build standard perl modules.

The plan is, you define the requirements, and let the module take care of the rest.

The requirements you must define are:

MOD_REQS

An arrayref of hashrefs. Each hashref represents a required Perl module, and has the following keys:

name

Mandatory Name of the module used. The presence of this module is checked, and an exception is raised if it does not exist.

package

Optional Name of the package in which the module is to be found. If not defined, the package is assumed to be present in core Perl.

Modules that have been in core Perl since 5.005 need not be listed; the "core perl" default is for modules such as Pod::Usage which have been added to the core since 5.005.

version

Optional If supplied, the version of the module is checked against this number, and an exception raised if the version found is lower than that requested.

optional

Optional If true, then failure to locate the package (or a suitable version) is not an error, but will generate a warning message.

message

If supplied, then this message will be given to the user in case of failure.

EXEC_REQS
name

Name of the executable used. The presence of this executable is checked, and an exception is raised if it does not exist (in the PATH).

package

Optional Name of the package in which the executable is to be found.

version

Optional If supplied, the version of the module is checked against this number, and an exception raised if the version found is lower than that requested.

If supplied, the vopt key must also be supplied.

vopt

Optional This is used only if the version key is also used. This is the option that is passed to the executable to ask for its version number. It may be the empty string if no option is used (but must be defined if version is defined).

vexpect

Optional This is used only if the version key is also used. This is the exit code to expect from the program when polling for its version number. Defaults to 0. This is the exit code (value of $? in the shell) to use, not the value of the wait call.

optional

Optional If true, then failure to locate the package (or a suitable version) is not an error, but will generate a warning message.

message

If supplied, then this message will be given to the user in case of failure.

NAME

The module name. It must conform to the established standard; in particular, it must not contain colon characters. The usual process, when providing a single-package module (e.g., to provide MIME::Base64), is to replace the :: occurences with hyphens (hence, MIME-Base64).

VERSION_FROM

The module from which to establish the version number. This module must have a line of the form $VERSION = '0.01';. Declarative prefixes (.e.g, our) are fine; our is the usual one, since $VERSION is almost always a package variable.

AUTHOR

The name of the module author(s), along with an email address. This is normally the person primarily responsible for the upkeep of the module.

ABSTRACT

A single (concise!) sentence describing the rough purpose of the module. It is not expected to be mightily accurate, but is for quick browsing of modules.

DEPENDS

Optional

If defined, this must be an arrayref of additional targets to insert into Makefile. Each element must be a hashref, with the following keys:

target

Name of the rule target

reqs

Arrayref of rule requisites

rules

Arrayref of rule lines. Do not precede these with a tab character; this will be inserted for you. Likewise, do not break the lines up.

E.g.,

  use constant DEPENDS      => [
                                { target => 'lib/Class/MethodMaker.pm',
                                  reqs   => [qw/ cmmg.pl /],
                                  rules  => [ '$(PERL) $< > $@' ],
                                },
                               ];
DERIVED_PM

Optional. If defined, this is expected to be an arrayref of file names (relative to the dist base), that are pm files to be installed.

By default, make.pm finds the pms to install by a conducting a find over the lib directory when perl Makefile.PL is run. However, for pm files that are created, that will be insufficient. By specifying extras with this constant, such files may be named (and therefore made), and also cleaned when a make clean is issued. This might well be used in conjunction with the DEPENDS constant to auto-make pm files.

E.g.,

  use constant DERIVED_PM     => [qw( lib/Class/MethodMaker.pm )];

EXAMPLES

BUGS

REPORTING BUGS

Email the author.

AUTHOR

Martyn J. Pearce fluffy@cpan.org

COPYRIGHT

Copyright (c) 2001, 2002, 2003 Martyn J. Pearce. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

1 POD Error

The following errors were encountered while parsing the POD:

Around line 508:

You forgot a '=back' before '=head1'