问题
Module installation varies when compared to Windows and linux/Unix Operating system.
In Win32 we need to use a program called nmake and after we follow
1. C:\> perl Makefile.PL
2. C:\> nmake
3. C:\> nmake test
4. C:\> nmake install
and in Linux we follow
1. $ perl Makefile.PL
2. $ make
3. $ make test
4. $ make install
the process of installing would be same for both the operating systems, the only difference would be in the keyword used make and nmake. Could any one let me know what does the letter n
represents and what is its specification in windows.
回答1:
From Wikipedia,
Microsoft nmake, commonly available on Windows. It is fairly basic in that it offers only a subset of the features of the other two versions of Make (BSD and GNU ). Microsoft's nmake is not to be confused with nmake from AT&T and Bell Labs for Unix.
Microsoft nmake
is detailed here and GNU make
is detailed here
回答2:
Actually, module installation is usually done as follows on Windows and linux:
cpan Module::Name
On to your question.
Perl expects the same compiler suite that was used to build Perl to be used to build the module.
There are two primary tool chains on Windows. There is the one provided by Microsoft and there is a port of GNU's.
- The make tool provided by Microsoft is named
nmake
. - The make tool provided by the MinGW port of GNU's tools is named
dmake
.
So,
- If your Perl was built using MS's tools (e.g. Windows builds of Perl by ActiveState), you need to to use
nmake
. - If your Perl was built using GNU's tools (e.g. builds of Perl by Strawberry), you need to to use
dmake
.
Which brings us back to cpan Module::Name
.
cpan
will ask Perl what tools were used to build it, and use those tools.
Normally. That's not the case on Windows. cpan
is actually far more flexible on Windows. cpan
will first look the tool chain that was used to build Perl. If it's not found, cpan
install the GNU tool chain for you and temporarily fool perl
into believing it was built using GNU's tool chain.
That means you run cpan Module::Name
it should work no matter what on ActivePerl. (And there's also ppm install Module::Name
, although I'd run ppm
with no arguments first to add repositories (e.g. bribes))
来源:https://stackoverflow.com/questions/9799584/comparison-of-make-and-nmake-for-perl-module-installation