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

📄 automake.texi

📁 LINUX下的源码工具,可自己分析,或者直接装在系统上作为应用
💻 TEXI
📖 第 1 页 / 共 5 页
字号:
\input texinfo   @c -*-texinfo-*-@c %**start of header@setfilename automake.info@settitle automake@setchapternewpage off@c %**end of header@include version.texi@dircategory GNU admin@direntry* automake: (automake).		Making Makefile.in's@end direntry@dircategory Individual utilities@direntry* aclocal: (automake)Invoking aclocal.          Generating aclocal.m4@end direntry@ifinfoThis file documents GNU automake @value{VERSION}Copyright (C) 1995, 96, 97, 98 Free Software Foundation, Inc.Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.@ignorePermission is granted to process this file through TeX and print theresults, provided the printed document carries copying permissionnotice identical to this one except for the removal of this paragraph@end ignorePermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translation approvedby the Foundation.@end ifinfo@titlepage@title GNU Automake@subtitle For version @value{VERSION}, @value{UPDATED}@author David MacKenzie and Tom Tromey@page@vskip 0pt plus 1filllCopyright @copyright{} 1995, 96 Free Software Foundation, Inc.@sp 2This is the first edition of the GNU Automake documentation,@*and is consistent with GNU Automake @value{VERSION}.@*@sp 2Published by the Free Software Foundation @*59 Temple Place - Suite 330, @*Boston, MA 02111-1307 USA @*Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.Permission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translationapproved by the Free Software Foundation.@end titlepage@c Define an index of configure output variables.@defcodeindex ov@c Define an index of configure variables.@defcodeindex cv@c Define an index of options.@defcodeindex op@c Define an index of targets.@defcodeindex tr@c Define an index of commands.@defcodeindex cm@c Put the macros and variables into their own index.@c @syncodeindex fn cp@syncodeindex ov vr@syncodeindex cv vr@syncodeindex fn vr@c Put everything else into one index (arbitrarily chosen to be the concept index).@syncodeindex op cp@syncodeindex tr cp@syncodeindex cm cp@ifinfo@node Top, Introduction, (dir), (dir)@comment  node-name,  next,  previous,  up@top GNU AutomakeThis file documents the GNU Automake package for creating GNUStandards-compliant Makefiles from template files.  This editiondocuments version @value{VERSION}.@menu* Introduction::                Automake's purpose* Generalities::                General ideas* Examples::                    Some example packages* Invoking Automake::           Creating a Makefile.in* configure::                   Scanning configure.in* Top level::                   The top-level Makefile.am* Programs::                    Building programs and libraries* Other objects::               Other derived objects* Other GNU Tools::             Other GNU Tools* Documentation::               Building documentation* Install::                     What gets installed* Clean::                       What gets cleaned* Dist::                        What goes in a distribution* Tests::                       Support for test suites* Options::                     Changing Automake's behavior* Miscellaneous::               Miscellaneous rules* Include::                     Including extra files in an Automake template.* Conditionals::                Conditionals* Gnits::                       The effect of @code{--gnu} and @code{--gnits}* Cygnus::                      The effect of @code{--cygnus}* Extending::                   Extending Automake* Distributing::                Distributing the Makefile.in* Future::                      Some ideas for the future* Macro and Variable Index::    * General Index::               @end menu@end ifinfo@node Introduction, Generalities, Top, Top@chapter IntroductionAutomake is a tool for automatically generating @file{Makefile.in}s fromfiles called @file{Makefile.am}.  Each @file{Makefile.am} is basically aseries of @code{make} macro definitions (with rules being thrown inoccasionally).  The generated @file{Makefile.in}s are compliant with theGNU Makefile standards.@cindex GNU Makefile standardsThe GNU Makefile Standards Document(@pxref{Makefile Conventions, , , standards, The GNU Coding Standards})is long, complicated, and subject to change.  The goal of Automake is toremove the burden of Makefile maintenance from the back of theindividual GNU maintainer (and put it on the back of the Automakemaintainer).The typical Automake input file is simply a series of macro definitions.Each such file is processed to create a @file{Makefile.in}.  Thereshould generally be one @file{Makefile.am} per directory of a project.@cindex Constraints of Automake@cindex Automake constraintsAutomake does constrain a project in certain ways; for instance itassumes that the project uses Autoconf (@pxref{Top, , Introduction,autoconf, The Autoconf Manual}), and enforces certain restrictions onthe @file{configure.in} contents.@cindex Automake requirements@cindex Requirements, AutomakeAutomake requires @code{perl} in order to generate the@file{Makefile.in}s.  However, the distributions created by Automake arefully GNU standards-compliant, and do not require @code{perl} in orderto be built.@cindex BUGS, reporting@cindex Reporting BUGS@cindex E-mail, bug reportsMail suggestions and bug reports for Automake to@email{bug-automake@@gnu.org}.@node Generalities, Examples, Introduction, Top@chapter General ideasThe following sections cover a few basic ideas that will help youunderstand how Automake works.@menu* General Operation::           General operation of Automake* Depth::                       The kinds of packages* Strictness::                  Standards conformance checking* Uniform::                     The Uniform Naming Scheme* Canonicalization::            How derived variables are named@end menu@node General Operation, Depth, Generalities, Generalities@section General OperationAutomake works by reading a @file{Makefile.am} and generating a@file{Makefile.in}.  Certain macros and targets defined in the@file{Makefile.am} instruct Automake to generate more specialized code;for instance, a @samp{bin_PROGRAMS} macro definition will cause targetsfor compiling and linking programs to be generated.@cindex Non-standard targets@cindex cvs-dist, non-standard example@trindex cvs-distThe macro definitions and targets in the @file{Makefile.am} are copiedverbatim into the generated file.  This allows you to add arbitrary codeinto the generated @file{Makefile.in}.  For instance the Automakedistribution includes a non-standard @code{cvs-dist} target, which theAutomake maintainer uses to make distributions from his source controlsystem.@cindex GNU make extensionsNote that GNU make extensions are not recognized by Automake.  Usingsuch extensions in a @file{Makefile.am} will lead to errors or confusingbehavior.Automake tries to group comments with adjoining targets and macrodefinitions in an intelligent way.@cindex Make targets, overriding@cindex Overriding make targetsA target defined in @file{Makefile.am} generally overrides any suchtarget of a similar name that would be automatically generated by@code{automake}.  Although this is a supported feature, it is generallybest to avoid making use of it, as sometimes the generated rules arevery particular.@cindex Macros, overriding@cindex Overriding make macrosSimilarly, a macro defined in @file{Makefile.am} will override anydefinition of the macro that @code{automake} would ordinarily create.This feature is more often useful than the ability to override a targetdefinition.  Be warned that many of the macros generated by@code{automake} are considered to be for internal use only, and theirnames might change in future releases.@cindex Recursive operation of Automake@cindex Automake, recursive operation@cindex Example of recursive operationWhen examining a macro definition, Automake will recursively examinemacros referenced in the definition.  For example, if Automake islooking at the content of @code{foo_SOURCES} in this snippet@examplexs = a.c b.cfoo_SOURCES = c.c $(xs)@end exampleit would use the files @file{a.c}, @file{b.c}, and @file{c.c} as thecontents of @code{foo_SOURCES}.@cindex ## (special Automake comment)@cindex Special Automake comment@cindex Comment, special to AutomakeAutomake also allows a form of comment which is @emph{not} copied intothe output; all lines beginning with @samp{##} are completely ignored byAutomake.It is customary to make the first line of @file{Makefile.am} read:@cindex Makefile.am, first line@cindex First line of Makefile.am@example## Process this file with automake to produce Makefile.in@end example@c FIXME discuss putting a copyright into Makefile.am here?  I would but@c I don't know quite what to say.@c FIXME document customary ordering of Makefile.am here!@node Depth, Strictness, General Operation, Generalities@section Depth@cindex Flat package@cindex Package, Flat@cindex Shallow package@cindex Package, shallow@cindex Deep package@cindex Package, deep@code{automake} supports three kinds of directory hierarchy:@samp{flat}, @samp{shallow}, and @samp{deep}.A @dfn{flat} package is one in which all the files are in a singledirectory.  The @file{Makefile.am} for such a package by definitionlacks a @code{SUBDIRS} macro.  An example of such a package is@code{termutils}.@vindex SUBDIRS@cindex SUBDIRS, deep packageA @dfn{deep} package is one in which all the source lies insubdirectories; the top level directory contains mainly configurationinformation.  GNU @code{cpio} is a good example of such a package, as isGNU @code{tar}.  The top level @file{Makefile.am} for a deep packagewill contain a @code{SUBDIRS} macro, but no other macros to defineobjects which are built.A @dfn{shallow} package is one in which the primary source resides inthe top-level directory, while various parts (typically libraries)reside in subdirectories.  Automake is one such package (as is GNU@code{make}, which does not currently use @code{automake}).@node Strictness, Uniform, Depth, Generalities@section Strictness@cindex Non-GNU packagesWhile Automake is intended to be used by maintainers of GNU packages, itdoes make some effort to accommodate those who wish to use it, but donot want to use all the GNU conventions.@cindex Strictness, defined@cindex Strictness, foreign@cindex foreign strictness@cindex Strictness, gnu@cindex gnits strictness@cindex Strictness, gnits@cindex gnits strictnessTo this end, Automake supports three levels of @dfn{strictness}---thestrictness indicating how stringently Automake should check standardsconformance.The valid strictness levels are:@table @samp@item foreignAutomake will check for only those things which are absolutelyrequired for proper operations.  For instance, whereas GNU standardsdictate the existence of a @file{NEWS} file, it will not be required inthis mode.  The name comes from the fact that Automake is intended to beused for GNU programs; these relaxed rules are not the standard mode ofoperation.@item gnuAutomake will check---as much as possible---for compliance to the GNUstandards for packages.  This is the default.@item gnitsAutomake will check for compliance to the as-yet-unwritten @dfn{Gnitsstandards}.  These are based on the GNU standards, but are even moredetailed.  Unless you are a Gnits standards contributor, it isrecommended that you avoid this option until such time as the Gnitsstandard is actually published.@end tableFor more information on the precise implications of the strictnesslevel, see @ref{Gnits}.@node Uniform, Canonicalization, Strictness, Generalities@section The Uniform Naming Scheme

⌨️ 快捷键说明

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