CPAN Module Distributions
a Perl script that generates a Makefile appropriate for the system where the module
is being installed.
...........................................................................................................................................................................................................................
What's a Makefile?
If you don't come from a UNIX programming background, you might not be
familiar with Makefiles. A Makefile is a script processed by a program called
make.
9
When make is run, it automatically looks for a file called Makefile in the
current directory. make uses the information stored in the Makefile to perform the
steps necessary to build and install programs from source files. To accomplish
this task, a Makefile specifies a set of rules and dependencies.
A Makefile rule is a particular step in the build process examples of rules you've
seen so far include test and install . When you run the command make test,
you're instructing make to run the test rule in the Makefile. Makefiles also sup
port the notion of a default rule that is run when no rule is explicitly specified,
usually called all .
Aside from rules that specify activities such as make test and make install,
Makefiles also have rules for creating files. One example of this type of rule is the
one used to turn a module's POD documentation into a UNIX manual page
through the pod2man program.
Makefiles combine rules by laying out rule dependencies. For example, the all
rule depends on the rule to build manual pages from POD documentation, among
others. Dependencies work in two ways. First, they specify a series of steps
describing how to complete a requested rule. Second, they allow make to intelli
gently skip rules when it can tell that the target is up to date. For example, make
can tell that it doesn't need to rerun pod2man unless the module file containing the
POD has been changed since the last time pod2man was run.
For more information about how Makefiles work on your system, see the docu
mentation for your make command.
...........................................................................................................................................................................................................................
The Makefile.PL that h2xs generates (see Listing 4 3) for Data::Counter is a
simple Perl script. The script uses a single module ExtUtils::MakeMaker.
10
The
subroutine WriteMakefile() is exported from ExtUtils::MakeMaker by default.
9. Or, on Microsoft Windows systems, possibly dmake or nmake. See the Installing CPAN
Modules section in Chapter 1 for details.
10. Written by Andy Dougherty, Andreas Koenig, Tim Bunce, Charles Bailey and Ilya
Zakharevich. It is included with Perl.
10
105
5
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved