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

📄 make-stds.texi

📁 autoconf是一个产生可以自动配置源代码包
💻 TEXI
📖 第 1 页 / 共 3 页
字号:
@item exec_prefix@vindex exec_prefixA prefix used in constructing the default values of some of thevariables listed below.  The default value of @code{exec_prefix} shouldbe @code{$(prefix)}.(If you are using Autoconf, write it as @samp{@@exec_prefix@@}.)Generally, @code{$(exec_prefix)} is used for directories that containmachine-specific files (such as executables and subroutine libraries),while @code{$(prefix)} is used directly for other directories.Running @samp{make install} with a different value of @code{exec_prefix}from the one used to build the program should @emph{not} recompile theprogram.@end tableExecutable programs are installed in one of the following directories.@table @code@item bindir@vindex bindirThe directory for installing executable programs that users can run.This should normally be @file{/usr/local/bin}, but write it as@file{$(exec_prefix)/bin}.(If you are using Autoconf, write it as @samp{@@bindir@@}.)@item sbindir@vindex sbindirThe directory for installing executable programs that can be run fromthe shell, but are only generally useful to system administrators.  Thisshould normally be @file{/usr/local/sbin}, but write it as@file{$(exec_prefix)/sbin}.(If you are using Autoconf, write it as @samp{@@sbindir@@}.)@item libexecdir@vindex libexecdir@comment This paragraph adjusted to avoid overfull hbox --roland 5jul94The directory for installing executable programs to be run by otherprograms rather than by users.  This directory should normally be@file{/usr/local/libexec}, but write it as @file{$(exec_prefix)/libexec}.(If you are using Autoconf, write it as @samp{@@libexecdir@@}.)The definition of @samp{libexecdir} is the same for all packages, soyou should install your data in a subdirectory thereof.  Most packagesinstall their data under @file{$(libexecdir)/@var{package-name}/},possibly within additional subdirectories thereof, such as@file{$(libexecdir)/@var{package-name}/@var{machine}/@var{version}}.@end tableData files used by the program during its execution are divided intocategories in two ways.@itemize @bullet@itemSome files are normally modified by programs; others are never normallymodified (though users may edit some of these).@itemSome files are architecture-independent and can be shared by allmachines at a site; some are architecture-dependent and can be sharedonly by machines of the same kind and operating system; others may neverbe shared between two machines.@end itemizeThis makes for six different possibilities.  However, we want todiscourage the use of architecture-dependent files, aside from objectfiles and libraries.  It is much cleaner to make other data filesarchitecture-independent, and it is generally not hard.Here are the variables Makefiles should use to specify directoriesto put these various kinds of files in:@table @samp@item datarootdirThe root of the directory tree for read-only architecture-independentdata files.  This should normally be @file{/usr/local/share}, butwrite it as @file{$(prefix)/share}.  (If you are using Autoconf, writeit as @samp{@@datarootdir@@}.)  @samp{datadir}'s default value isbased on this variable; so are @samp{infodir}, @samp{mandir}, andothers.@item datadirThe directory for installing idiosyncratic read-onlyarchitecture-independent data files for this program.  This is usuallythe same place as @samp{datarootdir}, but we use the two separatevariables so that you can move these program-specific files withoutaltering the location for Info files, man pages, etc.This should normally be @file{/usr/local/share}, but write it as@file{$(datarootdir)}.  (If you are using Autoconf, write it as@samp{@@datadir@@}.)The definition of @samp{datadir} is the same for all packages, so youshould install your data in a subdirectory thereof.  Most packagesinstall their data under @file{$(datadir)/@var{package-name}/}.@item sysconfdirThe directory for installing read-only data files that pertain to asingle machine--that is to say, files for configuring a host.  Mailerand network configuration files, @file{/etc/passwd}, and so forth belonghere.  All the files in this directory should be ordinary ASCII textfiles.  This directory should normally be @file{/usr/local/etc}, butwrite it as @file{$(prefix)/etc}.(If you are using Autoconf, write it as @samp{@@sysconfdir@@}.)Do not install executables here in this directory (they probably belongin @file{$(libexecdir)} or @file{$(sbindir)}).  Also do not installfiles that are modified in the normal course of their use (programswhose purpose is to change the configuration of the system excluded).Those probably belong in @file{$(localstatedir)}.@item sharedstatedirThe directory for installing architecture-independent data files whichthe programs modify while they run.  This should normally be@file{/usr/local/com}, but write it as @file{$(prefix)/com}.(If you are using Autoconf, write it as @samp{@@sharedstatedir@@}.)@item localstatedirThe directory for installing data files which the programs modify whilethey run, and that pertain to one specific machine.  Users should neverneed to modify files in this directory to configure the package'soperation; put such configuration information in separate files that goin @file{$(datadir)} or @file{$(sysconfdir)}.  @file{$(localstatedir)}should normally be @file{/usr/local/var}, but write it as@file{$(prefix)/var}.(If you are using Autoconf, write it as @samp{@@localstatedir@@}.)@end tableThese variables specify the directory for installing certain specifictypes of files, if your program has them.  Every GNU package shouldhave Info files, so every program needs @samp{infodir}, but not allneed @samp{libdir} or @samp{lispdir}.@table @samp@item includedir@c rewritten to avoid overfull hbox --rolandThe directory for installing header files to be included by userprograms with the C @samp{#include} preprocessor directive.  Thisshould normally be @file{/usr/local/include}, but write it as@file{$(prefix)/include}.(If you are using Autoconf, write it as @samp{@@includedir@@}.)Most compilers other than GCC do not look for header files in directory@file{/usr/local/include}.  So installing the header files this way isonly useful with GCC.  Sometimes this is not a problem because somelibraries are only really intended to work with GCC.  But some librariesare intended to work with other compilers.  They should install theirheader files in two places, one specified by @code{includedir} and onespecified by @code{oldincludedir}.@item oldincludedirThe directory for installing @samp{#include} header files for use withcompilers other than GCC.  This should normally be @file{/usr/include}.(If you are using Autoconf, you can write it as @samp{@@oldincludedir@@}.)The Makefile commands should check whether the value of@code{oldincludedir} is empty.  If it is, they should not try to useit; they should cancel the second installation of the header files.A package should not replace an existing header in this directory unlessthe header came from the same package.  Thus, if your Foo packageprovides a header file @file{foo.h}, then it should install the headerfile in the @code{oldincludedir} directory if either (1) there is no@file{foo.h} there or (2) the @file{foo.h} that exists came from the Foopackage.To tell whether @file{foo.h} came from the Foo package, put a magicstring in the file---part of a comment---and @code{grep} for that string.@item docdirThe directory for installing documentation files (other than Info) forthis package.  By default, it should be@file{/usr/local/share/doc/@var{yourpkg}}, but it should be written as@file{$(datarootdir)/doc/@var{yourpkg}}.  (If you are using Autoconf,write it as @samp{@@docdir@@}.)  The @var{yourpkg} subdirectory, whichmay include a version number, prevents collisions among files withcommon names, such as @file{README}.@item infodirThe directory for installing the Info files for this package.  Bydefault, it should be @file{/usr/local/share/info}, but it should bewritten as @file{$(datarootdir)/info}.  (If you are using Autoconf,write it as @samp{@@infodir@@}.)  @code{infodir} is separate from@code{docdir} for compatibility with existing practice.@item htmldir@itemx dvidir@itemx pdfdir@itemx psdirDirectories for installing documentation files in the particularformat.  (It is not required to support documentation in all theseformats.)  They should all be set to @code{$(docdir)} by default.  (Ifyou are using Autoconf, write them as @samp{@@htmldir@@},@samp{@@dvidir@@}, etc.)  Packages which supply several translationsof their documentation should install them in@samp{$(htmldir)/}@var{ll}, @samp{$(pdfdir)/}@var{ll}, etc. where@var{ll} is a locale abbreviation such as @samp{en} or @samp{pt_BR}.@item libdirThe directory for object files and libraries of object code.  Do notinstall executables here, they probably ought to go in @file{$(libexecdir)}instead.  The value of @code{libdir} should normally be@file{/usr/local/lib}, but write it as @file{$(exec_prefix)/lib}.(If you are using Autoconf, write it as @samp{@@libdir@@}.)@item lispdirThe directory for installing any Emacs Lisp files in this package.  Bydefault, it should be @file{/usr/local/share/emacs/site-lisp}, but itshould be written as @file{$(datarootdir)/emacs/site-lisp}.If you are using Autoconf, write the default as @samp{@@lispdir@@}.In order to make @samp{@@lispdir@@} work, you need the following linesin your @file{configure.in} file:@examplelispdir='$@{datarootdir@}/emacs/site-lisp'AC_SUBST(lispdir)@end example@item localedirThe directory for installing locale-specific message catalogs for thispackage.  By default, it should be @file{/usr/local/share/locale}, butit should be written as @file{$(datarootdir)/locale}.  (If you areusing Autoconf, write it as @samp{@@localedir@@}.)  This directoryusually has a subdirectory per locale.@end tableUnix-style man pages are installed in one of the following:@table @samp@item mandirThe top-level directory for installing the man pages (if any) for thispackage.  It will normally be @file{/usr/local/share/man}, but youshould write it as @file{$(datarootdir)/man}.  (If you are usingAutoconf, write it as @samp{@@mandir@@}.)@item man1dirThe directory for installing section 1 man pages.  Write it as@file{$(mandir)/man1}.@item man2dirThe directory for installing section 2 man pages.  Write it as@file{$(mandir)/man2}@item @dots{}@strong{Don't make the primary documentation for any GNU software be aman page.  Write a manual in Texinfo instead.  Man pages are just forthe sake of people running GNU software on Unix, which is a secondaryapplication only.}@item manextThe file name extension for the installed man page.  This should containa period followed by the appropriate digit; it should normally be @samp{.1}.@item man1extThe file name extension for installed section 1 man pages.@item man2extThe file name extension for installed section 2 man pages.@item @dots{}Use these names instead of @samp{manext} if the package needs to install manpages in more than one section of the manual.@end tableAnd finally, you should set the following variable:@table @samp@item srcdirThe directory for the sources being compiled.  The value of thisvariable is normally inserted by the @code{configure} shell script.(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.)@end tableFor example:@smallexample@c I have changed some of the comments here slightly to fix an overfull@c hbox, so the make manual can format correctly. --roland# Common prefix for installation directories.# NOTE: This directory must exist when you start the install.prefix = /usr/localdatarootdir = $(prefix)/sharedatadir = $(datarootdir)exec_prefix = $(prefix)# Where to put the executable for the command `gcc'.bindir = $(exec_prefix)/bin# Where to put the directories used by the compiler.libexecdir = $(exec_prefix)/libexec# Where to put the Info files.infodir = $(datarootdir)/info@end smallexampleIf your program installs a large number of files into one of thestandard user-specified directories, it might be useful to group theminto a subdirectory particular to that program.  If you do this, youshould write the @code{install} rule to create these subdirectories.Do not expect the user to include the subdirectory name in the value ofany of the variables listed above.  The idea of having a uniform set ofvariable names for installation directories is to enable the user tospecify the exact same values for several different GNU packages.  Inorder for this to be useful, all the packages must be designed so thatthey will work sensibly when the user does so.Not all of these variables may be implemented in the current releaseof Autoconf and/or Automake; right now, that includes at least@code{docdir}, @code{psdir}, @code{pdfdir}, @code{htmldir},@code{dvidir}.  In these cases, the descriptions here serve asspecifications for what Autoconf will implement.  As a programmer, youcan either use a development version of Autoconf or avoid using thesevariables until a stable release is made which supports them.@node Standard Targets@section Standard Targets for UsersAll GNU programs should have the following targets in their Makefiles:@table @samp@item allCompile the entire program.  This should be the default target.  Thistarget need not rebuild any documentation files; Info files shouldnormally be included in the distribution, and DVI files should be madeonly when explicitly asked for.By default, the Make rules should compile and link with @samp{-g}, sothat executable programs have debugging symbols.  Users who don't mindbeing helpless can strip the executables later if they wish.@item installCompile the program and copy the executables, libraries, and so on tothe file names where they should reside for actual use.  If there is asimple test to verify that a program is properly installed, this targetshould run that test.Do not strip executables when installing them.  Devil-may-care users canuse the @code{install-strip} target to do that.If possible, write the @code{install} target rule so that it does notmodify anything in the directory where the program was built, provided@samp{make all} has just been done.  This is convenient for building theprogram under one user name and installing it under another.The commands should create all the directories in which files are to beinstalled, if they don't already exist.  This includes the directoriesspecified as the values of the variables @code{prefix} and@code{exec_prefix}, as well as all subdirectories that are needed.One way to do this is by means of an @code{installdirs} targetas described below.Use @samp{-} before any command for installing a man page, so that@code{make} will ignore any errors.  This is in case there are systemsthat don't have the Unix man page documentation system installed.The way to install Info files is to copy them into @file{$(infodir)}with @code{$(INSTALL_DATA)} (@pxref{Command Variables}), and then runthe @code{install-info} program if it is present.  @code{install-info}is a program that edits the Info @file{dir} file to add or update themenu entry for the given Info file; it is part of the Texinfo package.Here is a sample rule to install an Info file:@comment This example has been carefully formatted for the Make manual.@comment Please do not reformat it without talking to roland@gnu.ai.mit.edu.@smallexample$(DESTDIR)$(infodir)/foo.info: foo.info        $(POST_INSTALL)# There may be a newer info file in . than in srcdir.        -if test -f foo.info; then d=.; \         else d=$(srcdir); fi; \        $(INSTALL_DATA) $$d/foo.info $(DESTDIR)$@@; \# Run install-info only if it exists.# Use `if' instead of just prepending `-' to the# line so we notice real errors from install-info.# We use `$(SHELL) -c' because some shells do not# fail gracefully when there is an unknown command.        if $(SHELL) -c 'install-info --version' \           >/dev/null 2>&1; then \          install-info --dir-file=$(DESTDIR)$(infodir)/dir \

⌨️ 快捷键说明

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