LPM: MakeMaker

Rich Bowen rbowen at rcbowen.com
Wed Dec 15 22:05:34 CST 1999


By the way, I've been playing with MakeMaker today and last night. I've
discovered that it is also a really handy way to build distributions of
files - not necessarily Perl modules, just files. all you have to have
is a MANIFEST that lists everything, and a Makefile.PL that gives the
NAME and where to get the VERSION_FROM, and when you make dist, it
builds a nice tar.gz file with the version number in the name. It's
enormously handy. Now I have no more excuses for putting off sending
intermediate releases to customers. "Well, I would, but I don't have
time to build a tar file for you of all the stuff ..." As long as you
keep MANIFEST up to date, you can just do 'perl Makefile.PL' and 'make
dist' and you have a release in about 20 seconds. I've started using it
to make nightly "builds" so that I can always go back to a previous
day's version. It also makes it really important to keep a good Changes
file.

MANIFEST looks like:
----BEGIN FILE---------------
MANIFEST
CHANGES
foo.pl
bar.html
baz.cgi
gromitz.c
docs/lalala.doc
-----END FILE----------------

And Makefile.PL looks like:
-----BEGIN FILE-------------
use ExtUtils::MakeMaker;
WriteMakefile(
	'NAME' => 'name_of_project',
	'VERSION_FROM' => 'foo.pl', # Contains $VERSION somewhere
);
------END FILE---------------

Then, when you want to make a distribution, you just type:

rm Makefile
perl Makefile.PL
make dist

And, viola, you have a file called name_of_project-version.tar.gz,
containing whatever files were listed in MANIFEST.

Rich
-- 
http://www.ApacheUnleashed.com/
Lexington Perl Mongers - http://lexington.pm.org/
PGP Key - http://www.rcbowen.com/pgp.txt



More information about the Lexington-pm mailing list