- Makefile.PL
- ExtUtils::MakeMaker
Makefile.PL for ExtUtils::MakeMaker
examples/distribution/project_with_extutils_makemaker/Makefile.PL
use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile ( NAME => 'MyTools', VERSION_FROM => 'lib/MyTools.pm', LICENSE => 'perl', PREREQ_PM => { 'Exporter' => '0', }, TEST_REQUIRES => { 'Test::Simple' => '1.00', }, );
Once you have setup the directory structure and created a simple Makefile.PL you can type the following:
$ perl Makefile.PL $ make $ make test
In the above three steps "perl Makefile.PL" checks if all the prerequisites are met and creates a Makefile.
make would compile your code if you had some C code in your application and also copy all the files to a new "blib" directory just in the project directory.
The most interesting for us is the third step: make test will run all your .t file within the t/ directory using Test::Harness. So you don't have to deal with it yourself and anyone who is familiar with the standard hierarchy of Perl modules will immediately know what to do.
In addition there are several other things you can do. Most notably you can execute the following command, and create the distribution you are supposed to upload to CPAN or to give to your users.
$ make manifest $ make dist