Hire a senior Perl / Python programmer today; download my up-to-date resume (PDF)
John Bokma Perl
freelance Perl programmer

Make for Windows: NMake

Make Perl modules | 11 comments

If a Perl module is not available for the ActiveState version of Perl (ActivePerl), you might be able to download it from the Comprehensive Perl Archive Network (CPAN), and try to build and install it on Microsoft Windows.

A frequently asked question: "Where can I find make for Windows?". The answer is: "Download and use NMake".

Downloading NMake

Since Microsoft Windows hasn't in it's default install a make program needed to build the Perl modules, you have to download NMake 1.5 from the Microsoft Knowledge Base, article 132084 page.

Installing NMake

Run the downloaded executable to extract the files. Copy both the NMAKE.EXE and the NMAKE.ERR file to your Perl bin directory, normally C:\Perl\bin. Make sure that you copy the NMAKE.ERR file as well.

Example of an NMake session

Normally building Perl modules and installing them consist of the following steps:

  1. perl Makefile.pl
  2. make
  3. make test
  4. make install

Just replace make with nmake, and in many cases this will result in a working module (or modules) installed in the proper location(s).

Below follows an example of building the Net-Google Perl module, and installing it. See Net-Google with ActiveState Perl for more information.

perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for Net::Google


Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

cp lib/Net/Google/Search.pm blib\lib\Net\Google\Search.pm
cp lib/Net/Google.pm blib\lib\Net\Google.pm
cp lib/Net/Google/tool.pm blib\lib\Net\Google\tool.pm
cp lib/Net/Google/Spelling.pm blib\lib\Net\Google\Spelling.pm
cp lib/Net/Google/Cache.pm blib\lib\Net\Google\Cache.pm
cp lib/Net/Google/Services/GoogleSearch.wsdl blib\lib\Net\Google
cp lib/Net/Google/Service.pm blib\lib\Net\Google\Service.pm
cp lib/Net/Google/Response.pm blib\lib\Net\Google\Response.pm

nmake test

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

    C:\Perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "tes
t_harness(0, 'blib\lib', 'blib\arch')" t\000-key.t t\001-search.
t t\002-spelling.t t\003-cache.t t\000-key.........#
# The Google API web service requires that you provide create a
Google Account and obtain a license key
# This key is then passed with each request you make to the Goog
le servers.
# If you do not already have a Google Account, you can sign up f
or one here:

# http://www.google.com/apis/
# Please enter your Google API key:
All tests successful.
Files=4, Tests=18, 103 wallclock secs ( 0.00 cusr +  0.00 csys =
0.00 CPU)

nmake install

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

Installing C:\Perl\site\lib\Net\Google.pm
Installing C:\Perl\site\lib\Net\Google\Cache.pm
Installing C:\Perl\site\lib\Net\Google\Response.pm
Installing C:\Perl\site\lib\Net\Google\Search.pm
Installing C:\Perl\site\lib\Net\Google\Service.pm
Installing C:\Perl\site\lib\Net\Google\Spelling.pm
Installing C:\Perl\site\lib\Net\Google\tool.pm
Installing C:\Perl\site\lib\Net\Google\Services\GoogleSearch.wsd
Appending installation info to C:\Perl\lib/perllocal.pod

Related links

Please post a comment | read 11 comments, latest by designatevoid | RSS feed