⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 extutils::makemaker.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 5 页
字号:
\&  {ANY_TARGET => ANY_DEPENDENCY, ...}.Ve.Sp(\s-1ANY_TARGET\s0 must not be given a double-colon rule by MakeMaker.).IP "dist" 2.IX Item "dist".Vb 3\&  {TARFLAGS => \*(AqcvfF\*(Aq, COMPRESS => \*(Aqgzip\*(Aq, SUFFIX => \*(Aq.gz\*(Aq,\&  SHAR => \*(Aqshar \-m\*(Aq, DIST_CP => \*(Aqln\*(Aq, ZIP => \*(Aq/bin/zip\*(Aq,\&  ZIPFLAGS => \*(Aq\-rl\*(Aq, DIST_DEFAULT => \*(Aqprivate tardist\*(Aq }.Ve.SpIf you specify \s-1COMPRESS\s0, then \s-1SUFFIX\s0 should also be altered, as it isneeded to tell make the target file of the compression. Setting\&\s-1DIST_CP\s0 to ln can be useful, if you need to preserve the timestamps onyour files. \s-1DIST_CP\s0 can take the values 'cp', which copies the file,\&'ln', which links the file, and 'best' which copies symbolic links andlinks the rest. Default is 'best'..IP "dynamic_lib" 2.IX Item "dynamic_lib".Vb 1\&  {ARMAYBE => \*(Aqar\*(Aq, OTHERLDFLAGS => \*(Aq...\*(Aq, INST_DYNAMIC_DEP => \*(Aq...\*(Aq}.Ve.IP "linkext" 2.IX Item "linkext".Vb 1\&  {LINKTYPE => \*(Aqstatic\*(Aq, \*(Aqdynamic\*(Aq or \*(Aq\*(Aq}.Ve.Sp\&\s-1NB:\s0 Extensions that have nothing but *.pm files had to say.Sp.Vb 1\&  {LINKTYPE => \*(Aq\*(Aq}.Ve.Spwith Pre\-5.0 MakeMakers. Since version 5.00 of MakeMaker such a linecan be deleted safely. MakeMaker recognizes when there's nothing tobe linked..IP "macro" 2.IX Item "macro".Vb 1\&  {ANY_MACRO => ANY_VALUE, ...}.Ve.IP "postamble" 2.IX Item "postamble"Anything put here will be passed to \fIMY::postamble()\fR if you have one..IP "realclean" 2.IX Item "realclean".Vb 1\&  {FILES => \*(Aq$(INST_ARCHAUTODIR)/*.xyz\*(Aq}.Ve.IP "test" 2.IX Item "test".Vb 1\&  {TESTS => \*(Aqt/*.t\*(Aq}.Ve.IP "tool_autosplit" 2.IX Item "tool_autosplit".Vb 1\&  {MAXLEN => 8}.Ve.Sh "Overriding MakeMaker Methods".IX Subsection "Overriding MakeMaker Methods"If you cannot achieve the desired Makefile behaviour by specifyingattributes you may define private subroutines in the Makefile.PL.Each subroutine returns the text it wishes to have written tothe Makefile. To override a section of the Makefile you caneither say:.PP.Vb 1\&        sub MY::c_o { "new literal text" }.Ve.PPor you can edit the default by saying something like:.PP.Vb 6\&        package MY; # so that "SUPER" works right\&        sub c_o {\&            my $inherited = shift\->SUPER::c_o(@_);\&            $inherited =~ s/old text/new text/;\&            $inherited;\&        }.Ve.PPIf you are running experiments with embedding perl as a library intoother applications, you might find MakeMaker is not sufficient. You'dbetter have a look at ExtUtils::Embed which is a collection of utilitiesfor embedding..PPIf you still need a different solution, try to develop anothersubroutine that fits your needs and submit the diffs to\&\f(CW\*(C`makemaker@perl.org\*(C'\fR.PPFor a complete description of all MakeMaker methods seeExtUtils::MM_Unix..PPHere is a simple example of how to add a new target to the generatedMakefile:.PP.Vb 4\&    sub MY::postamble {\&        return <<\*(AqMAKE_FRAG\*(Aq;\&    $(MYEXTLIB): sdbm/Makefile\&            cd sdbm && $(MAKE) all\&\&    MAKE_FRAG\&    }.Ve.Sh "The End Of Cargo Cult Programming".IX Subsection "The End Of Cargo Cult Programming"\&\fIWriteMakefile()\fR now does some basic sanity checks on its parameters toprotect against typos and malformatted values.  This means some thingswhich happened to work in the past will now throw warnings andpossibly produce internal errors..PPSome of the most common mistakes:.ie n .IP """MAN3PODS => \*(Aq \*(Aq""" 2.el .IP "\f(CWMAN3PODS => \*(Aq \*(Aq\fR" 2.IX Item "MAN3PODS =>  "This is commonly used to suppress the creation of man pages.  \s-1MAN3PODS\s0takes a hash ref not a string, but the above worked by accident in oldversions of MakeMaker..SpThe correct code is \f(CW\*(C`MAN3PODS => { }\*(C'\fR..Sh "Hintsfile support".IX Subsection "Hintsfile support"MakeMaker.pm uses the architecture specific information fromConfig.pm. In addition it evaluates architecture specific hints filesin a \f(CW\*(C`hints/\*(C'\fR directory. The hints files are expected to be namedlike their counterparts in \f(CW\*(C`PERL_SRC/hints\*(C'\fR, but with an \f(CW\*(C`.pl\*(C'\fR filename extension (eg. \f(CW\*(C`next_3_2.pl\*(C'\fR). They are simply \f(CW\*(C`eval\*(C'\fRed byMakeMaker within the \fIWriteMakefile()\fR subroutine, and can be used toexecute commands as well as to include special variables. The ruleswhich hintsfile is chosen are the same as in Configure..PPThe hintsfile is \fIeval()\fRed immediately after the arguments given toWriteMakefile are stuffed into a hash reference \f(CW$self\fR but before thisreference becomes blessed. So if you want to do the equivalent tooverride or create an attribute you would say something like.PP.Vb 1\&    $self\->{LIBS} = [\*(Aq\-ldbm \-lucb \-lc\*(Aq];.Ve.Sh "Distribution Support".IX Subsection "Distribution Support"For authors of extensions MakeMaker provides several Makefiletargets. Most of the support comes from the ExtUtils::Manifest module,where additional documentation can be found..IP "make distcheck" 4.IX Item "make distcheck"reports which files are below the build directory but not in the\&\s-1MANIFEST\s0 file and vice versa. (See \fIExtUtils::Manifest::fullcheck()\fR fordetails).IP "make skipcheck" 4.IX Item "make skipcheck"reports which files are skipped due to the entries in the\&\f(CW\*(C`MANIFEST.SKIP\*(C'\fR file (See \fIExtUtils::Manifest::skipcheck()\fR fordetails).IP "make distclean" 4.IX Item "make distclean"does a realclean first and then the distcheck. Note that this is notneeded to build a new distribution as long as you are sure that the\&\s-1MANIFEST\s0 file is ok..IP "make manifest" 4.IX Item "make manifest"rewrites the \s-1MANIFEST\s0 file, adding all remaining files found (See\&\fIExtUtils::Manifest::mkmanifest()\fR for details).IP "make distdir" 4.IX Item "make distdir"Copies all the files that are in the \s-1MANIFEST\s0 file to a newly createddirectory with the name \f(CW\*(C`$(DISTNAME)\-$(VERSION)\*(C'\fR. If that directoryexists, it will be removed first..SpAdditionally, it will create a \s-1META\s0.yml module meta-data file in thedistdir and add this to the distdir's \s-1MANIFEST\s0.  You can shut thisbehavior off with the \s-1NO_META\s0 flag..IP "make disttest" 4.IX Item "make disttest"Makes a distdir first, and runs a \f(CW\*(C`perl Makefile.PL\*(C'\fR, a make, anda make test in that directory..IP "make tardist" 4.IX Item "make tardist"First does a distdir. Then a command $(\s-1PREOP\s0) which defaults to a nullcommand, followed by $(\s-1TO_UNIX\s0), which defaults to a null command under\&\s-1UNIX\s0, and will convert files in distribution directory to \s-1UNIX\s0 formatotherwise. Next it runs \f(CW\*(C`tar\*(C'\fR on that directory into a tarfile anddeletes the directory. Finishes with a command $(\s-1POSTOP\s0) whichdefaults to a null command..IP "make dist" 4.IX Item "make dist"Defaults to $(\s-1DIST_DEFAULT\s0) which in turn defaults to tardist..IP "make uutardist" 4.IX Item "make uutardist"Runs a tardist first and uuencodes the tarfile..IP "make shdist" 4.IX Item "make shdist"First does a distdir. Then a command $(\s-1PREOP\s0) which defaults to a nullcommand. Next it runs \f(CW\*(C`shar\*(C'\fR on that directory into a sharfile anddeletes the intermediate directory again. Finishes with a command$(\s-1POSTOP\s0) which defaults to a null command.  Note: For shdist to workproperly a \f(CW\*(C`shar\*(C'\fR program that can handle directories is mandatory..IP "make zipdist" 4.IX Item "make zipdist"First does a distdir. Then a command $(\s-1PREOP\s0) which defaults to a nullcommand. Runs \f(CW\*(C`$(ZIP) $(ZIPFLAGS)\*(C'\fR on that directory into azipfile. Then deletes that directory. Finishes with a command$(\s-1POSTOP\s0) which defaults to a null command..IP "make ci" 4.IX Item "make ci"Does a $(\s-1CI\s0) and a $(\s-1RCS_LABEL\s0) on all files in the \s-1MANIFEST\s0 file..PPCustomization of the dist targets can be done by specifying a hashreference to the dist attribute of the WriteMakefile call. Thefollowing parameters are recognized:.PP.Vb 12\&    CI           (\*(Aqci \-u\*(Aq)\&    COMPRESS     (\*(Aqgzip \-\-best\*(Aq)\&    POSTOP       (\*(Aq@ :\*(Aq)\&    PREOP        (\*(Aq@ :\*(Aq)\&    TO_UNIX      (depends on the system)\&    RCS_LABEL    (\*(Aqrcs \-q \-Nv$(VERSION_SYM):\*(Aq)\&    SHAR         (\*(Aqshar\*(Aq)\&    SUFFIX       (\*(Aq.gz\*(Aq)\&    TAR          (\*(Aqtar\*(Aq)\&    TARFLAGS     (\*(Aqcvf\*(Aq)\&    ZIP          (\*(Aqzip\*(Aq)\&    ZIPFLAGS     (\*(Aq\-r\*(Aq).Ve.PPAn example:.PP.Vb 1\&    WriteMakefile( \*(Aqdist\*(Aq => { COMPRESS=>"bzip2", SUFFIX=>".bz2" }).Ve.Sh "Module Meta-Data".IX Subsection "Module Meta-Data"Long plaguing users of MakeMaker based modules has been the problem ofgetting basic information about the module out of the sources\&\fIwithout\fR running the \fIMakefile.PL\fR and doing a bunch of messyheuristics on the resulting \fIMakefile\fR.  To this end a simple modulemeta-data file has been introduced, \fI\s-1META\s0.yml\fR..PP\&\fI\s-1META\s0.yml\fR is a \s-1YAML\s0 document (see http://www.yaml.org) containingbasic information about the module (name, version, prerequisites...)in an easy to read format.  The format is developed and defined by theModule::Build developers (see http://module\-build.sourceforge.net/META\-spec.html).PPMakeMaker will automatically generate a \fI\s-1META\s0.yml\fR file for you andadd it to your \fI\s-1MANIFEST\s0\fR as part of the 'distdir' target (and thusthe 'dist' target).  This is intended to seamlessly and rapidlypopulate \s-1CPAN\s0 with module meta-data.  If you wish to shut this featureoff, set the \f(CW\*(C`NO_META\*(C'\fR \f(CW\*(C`WriteMakefile()\*(C'\fR flag to true..Sh "Disabling an extension".IX Subsection "Disabling an extension"If some events detected in \fIMakefile.PL\fR imply that there is no wayto create the Module, but this is a normal state of things, then youcan create a \fIMakefile\fR which does nothing, but succeeds on all the\&\*(L"usual\*(R" build targets.  To do so, use.PP.Vb 2\&    use ExtUtils::MakeMaker qw(WriteEmptyMakefile);\&    WriteEmptyMakefile();.Ve.PPinstead of \fIWriteMakefile()\fR..PPThis may be useful if other modules expect this module to be \fIbuilt\fR\&\s-1OK\s0, as opposed to \fIwork\fR \s-1OK\s0 (say, this system-dependent module buildsin a subdirectory of some other distribution, or is listed as adependency in a CPAN::Bundle, but the functionality is supported bydifferent means on the current architecture)..Sh "Other Handy Functions".IX Subsection "Other Handy Functions".IP "prompt" 4.IX Item "prompt".Vb 2\&    my $value = prompt($message);\&    my $value = prompt($message, $default);.Ve.SpThe \f(CW\*(C`prompt()\*(C'\fR function provides an easy way to request user inputused to write a makefile.  It displays the \f(CW$message\fR as a prompt forinput.  If a \f(CW$default\fR is provided it will be used as a default.  Thefunction returns the \f(CW$value\fR selected by the user..SpIf \f(CW\*(C`prompt()\*(C'\fR detects that it is not running interactively and thereis nothing on \s-1STDIN\s0 or if the \s-1PERL_MM_USE_DEFAULT\s0 environment variableis set to true, the \f(CW$default\fR will be used without prompting.  Thisprevents automated processes from blocking on user input..SpIf no \f(CW$default\fR is provided an empty string will be used instead..SH "ENVIRONMENT".IX Header "ENVIRONMENT".IP "\s-1PERL_MM_OPT\s0" 4.IX Item "PERL_MM_OPT"Command line options used by \f(CW\*(C`MakeMaker\->new()\*(C'\fR, and thus by\&\f(CW\*(C`WriteMakefile()\*(C'\fR.  The string is split on whitespace, and the resultis processed before any actual command line arguments are processed..IP "\s-1PERL_MM_USE_DEFAULT\s0" 4.IX Item "PERL_MM_USE_DEFAULT"If set to a true value then MakeMaker's prompt function willalways return the default without waiting for user input..IP "\s-1PERL_CORE\s0" 4.IX Item "PERL_CORE"Same as the \s-1PERL_CORE\s0 parameter.  The parameter overrides this..SH "SEE ALSO".IX Header "SEE ALSO"Module::Build is a pure-Perl alternative to MakeMaker which doesnot rely on make or any other external utility.  It is easier toextend to suit your needs..PPModule::Install is a wrapper around MakeMaker which adds featuresnot normally available..PPExtUtils::ModuleMaker and Module::Starter are both modules tohelp you setup your distribution..SH "AUTHORS".IX Header "AUTHORS"Andy Dougherty \f(CW\*(C`doughera@lafayette.edu\*(C'\fR, Andreas Ko\*:nig\&\f(CW\*(C`andreas.koenig@mind.de\*(C'\fR, Tim Bunce \f(CW\*(C`timb@cpan.org\*(C'\fR.  \s-1VMS\s0support by Charles Bailey \f(CW\*(C`bailey@newman.upenn.edu\*(C'\fR.  \s-1OS/2\s0 supportby Ilya Zakharevich \f(CW\*(C`ilya@math.ohio\-state.edu\*(C'\fR..PPCurrently maintained by Michael G Schwern \f(CW\*(C`schwern@pobox.com\*(C'\fR.PPSend patches and ideas to \f(CW\*(C`makemaker@perl.org\*(C'\fR..PPSend bug reports via http://rt.cpan.org/.  Please send yourgenerated Makefile along with your report..PPFor more up-to-date information, see <http://www.makemaker.org>..SH "LICENSE".IX Header "LICENSE"This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself..PPSee <http://www.perl.com/perl/misc/Artistic.html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -