* standards.texi: Import 22 July 2007 version.

* fdl.texi: Import version 1.2.
* make-stds.texi: Import 2006 version.
This commit is contained in:
Nick Clifton 2007-08-13 09:45:22 +00:00
parent fc7c811f03
commit e31a79b1d6
4 changed files with 1276 additions and 582 deletions

View File

@ -1,3 +1,9 @@
2007-08-13 Nick Clifton <nickc@redhat.com>
* standards.texi: Import 22 July 2007 version.
* fdl.texi: Import version 1.2.
* make-stds.texi: Import 2006 version.
2007-04-04 Eric Christopher <echristo@apple.com>
Move from gcc:

View File

@ -1,28 +1,28 @@
@c -*-texinfo-*-
@node GNU Free Documentation License, , , Copying This Manual
@c The GNU Free Documentation License.
@center Version 1.2, November 2002
@appendix GNU Free Documentation License
@center Version 1.1, March 2000
@c This file is intended to be included within another document,
@c hence no sectioning command or @node.
@display
Copyright (C) 2000 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
@end display
@sp 1
@enumerate 0
@item
PREAMBLE
The purpose of this License is to make a manual, textbook, or other
written document ``free'' in the sense of freedom: to assure everyone
the effective freedom to copy and redistribute it, with or without
modifying it, either commercially or noncommercially. Secondarily,
this License preserves for the author and publisher a way to get
credit for their work, while not being considered responsible for
modifications made by others.
functional and useful document @dfn{free} in the sense of freedom: to
assure everyone the effective freedom to copy and redistribute it,
with or without modifying it, either commercially or noncommercially.
Secondarily, this License preserves for the author and publisher a way
to get credit for their work, while not being considered responsible
for modifications made by others.
This License is a kind of ``copyleft'', which means that derivative
works of the document must themselves be free in the same sense. It
@ -37,60 +37,72 @@ it can be used for any textual work, regardless of subject matter or
whether it is published as a printed book. We recommend this License
principally for works whose purpose is instruction or reference.
@sp 1
@item
APPLICABILITY AND DEFINITIONS
This License applies to any manual or other work that contains a
notice placed by the copyright holder saying it can be distributed
under the terms of this License. The ``Document'', below, refers to any
such manual or work. Any member of the public is a licensee, and is
addressed as ``you.''
This License applies to any manual or other work, in any medium, that
contains a notice placed by the copyright holder saying it can be
distributed under the terms of this License. Such a notice grants a
world-wide, royalty-free license, unlimited in duration, to use that
work under the conditions stated herein. The ``Document'', below,
refers to any such manual or work. Any member of the public is a
licensee, and is addressed as ``you''. You accept the license if you
copy, modify or distribute the work in a way requiring permission
under copyright law.
A ``Modified Version'' of the Document means any work containing the
Document or a portion of it, either copied verbatim, or with
modifications and/or translated into another language.
A ``Secondary Section'' is a named appendix or a front-matter section of
the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall subject
(or to related matters) and contains nothing that could fall directly
within that overall subject. (For example, if the Document is in part a
textbook of mathematics, a Secondary Section may not explain any
mathematics.) The relationship could be a matter of historical
A ``Secondary Section'' is a named appendix or a front-matter section
of the Document that deals exclusively with the relationship of the
publishers or authors of the Document to the Document's overall
subject (or to related matters) and contains nothing that could fall
directly within that overall subject. (Thus, if the Document is in
part a textbook of mathematics, a Secondary Section may not explain
any mathematics.) The relationship could be a matter of historical
connection with the subject or with related matters, or of legal,
commercial, philosophical, ethical or political position regarding
them.
The ``Invariant Sections'' are certain Secondary Sections whose titles
are designated, as being those of Invariant Sections, in the notice
that says that the Document is released under this License.
that says that the Document is released under this License. If a
section does not fit the above definition of Secondary then it is not
allowed to be designated as Invariant. The Document may contain zero
Invariant Sections. If the Document does not identify any Invariant
Sections then there are none.
The ``Cover Texts'' are certain short passages of text that are listed,
as Front-Cover Texts or Back-Cover Texts, in the notice that says that
the Document is released under this License.
the Document is released under this License. A Front-Cover Text may
be at most 5 words, and a Back-Cover Text may be at most 25 words.
A ``Transparent'' copy of the Document means a machine-readable copy,
represented in a format whose specification is available to the
general public, whose contents can be viewed and edited directly and
general public, that is suitable for revising the document
straightforwardly with generic text editors or (for images composed of
pixels) generic paint programs or (for drawings) some widely available
drawing editor, and that is suitable for input to text formatters or
for automatic translation to a variety of formats suitable for input
to text formatters. A copy made in an otherwise Transparent file
format whose markup has been designed to thwart or discourage
subsequent modification by readers is not Transparent. A copy that is
not ``Transparent'' is called ``Opaque.''
format whose markup, or absence of markup, has been arranged to thwart
or discourage subsequent modification by readers is not Transparent.
An image format is not Transparent if used for any substantial amount
of text. A copy that is not ``Transparent'' is called ``Opaque''.
Examples of suitable formats for Transparent copies include plain
ASCII without markup, Texinfo input format, LaTeX input format, SGML
or XML using a publicly available DTD, and standard-conforming simple
HTML designed for human modification. Opaque formats include
PostScript, PDF, proprietary formats that can be read and edited only
by proprietary word processors, SGML or XML for which the DTD and/or
processing tools are not generally available, and the
machine-generated HTML produced by some word processors for output
purposes only.
@sc{ascii} without markup, Texinfo input format, La@TeX{} input
format, @acronym{SGML} or @acronym{XML} using a publicly available
@acronym{DTD}, and standard-conforming simple @acronym{HTML},
PostScript or @acronym{PDF} designed for human modification. Examples
of transparent image formats include @acronym{PNG}, @acronym{XCF} and
@acronym{JPG}. Opaque formats include proprietary formats that can be
read and edited only by proprietary word processors, @acronym{SGML} or
@acronym{XML} for which the @acronym{DTD} and/or processing tools are
not generally available, and the machine-generated @acronym{HTML},
PostScript or @acronym{PDF} produced by some word processors for
output purposes only.
The ``Title Page'' means, for a printed book, the title page itself,
plus such following pages as are needed to hold, legibly, the material
@ -98,7 +110,22 @@ this License requires to appear in the title page. For works in
formats which do not have any title page as such, ``Title Page'' means
the text near the most prominent appearance of the work's title,
preceding the beginning of the body of the text.
@sp 1
A section ``Entitled XYZ'' means a named subunit of the Document whose
title either is precisely XYZ or contains XYZ in parentheses following
text that translates XYZ in another language. (Here XYZ stands for a
specific section name mentioned below, such as ``Acknowledgements'',
``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title''
of such a section when you modify the Document means that it remains a
section ``Entitled XYZ'' according to this definition.
The Document may include Warranty Disclaimers next to the notice which
states that this License applies to the Document. These Warranty
Disclaimers are considered to be included by reference in this
License, but only as regards disclaiming warranties: any other
implication that these Warranty Disclaimers may have is void and has
no effect on the meaning of this License.
@item
VERBATIM COPYING
@ -114,13 +141,14 @@ number of copies you must also follow the conditions in section 3.
You may also lend copies, under the same conditions stated above, and
you may publicly display copies.
@sp 1
@item
COPYING IN QUANTITY
If you publish printed copies of the Document numbering more than 100,
and the Document's license notice requires Cover Texts, you must enclose
the copies in covers that carry, clearly and legibly, all these Cover
If you publish printed copies (or copies in media that commonly have
printed covers) of the Document, numbering more than 100, and the
Document's license notice requires Cover Texts, you must enclose the
copies in covers that carry, clearly and legibly, all these Cover
Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
the back cover. Both covers must also clearly and legibly identify
you as the publisher of these copies. The front cover must present
@ -138,21 +166,20 @@ pages.
If you publish or distribute Opaque copies of the Document numbering
more than 100, you must either include a machine-readable Transparent
copy along with each Opaque copy, or state in or with each Opaque copy
a publicly-accessible computer-network location containing a complete
Transparent copy of the Document, free of added material, which the
general network-using public has access to download anonymously at no
charge using public-standard network protocols. If you use the latter
option, you must take reasonably prudent steps, when you begin
distribution of Opaque copies in quantity, to ensure that this
Transparent copy will remain thus accessible at the stated location
until at least one year after the last time you distribute an Opaque
copy (directly or through your agents or retailers) of that edition to
the public.
a computer-network location from which the general network-using
public has access to download using public-standard network protocols
a complete Transparent copy of the Document, free of added material.
If you use the latter option, you must take reasonably prudent steps,
when you begin distribution of Opaque copies in quantity, to ensure
that this Transparent copy will remain thus accessible at the stated
location until at least one year after the last time you distribute an
Opaque copy (directly or through your agents or retailers) of that
edition to the public.
It is requested, but not required, that you contact the authors of the
Document well before redistributing any large number of copies, to give
them a chance to provide you with an updated version of the Document.
@sp 1
@item
MODIFICATIONS
@ -163,52 +190,85 @@ Version filling the role of the Document, thus licensing distribution
and modification of the Modified Version to whoever possesses a copy
of it. In addition, you must do these things in the Modified Version:
A. Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.@*
B. List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has less than five).@*
C. State on the Title page the name of the publisher of the
Modified Version, as the publisher.@*
D. Preserve all the copyright notices of the Document.@*
E. Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.@*
F. Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.@*
G. Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.@*
H. Include an unaltered copy of this License.@*
I. Preserve the section entitled ``History'', and its title, and add to
it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.@*
J. Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.@*
K. In any section entitled ``Acknowledgements'' or ``Dedications'',
preserve the section's title, and preserve in the section all the
substance and tone of each of the contributor acknowledgements
and/or dedications given therein.@*
L. Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.@*
M. Delete any section entitled ``Endorsements.'' Such a section
may not be included in the Modified Version.@*
N. Do not retitle any existing section as ``Endorsements''
or to conflict in title with any Invariant Section.@*
@sp 1
@enumerate A
@item
Use in the Title Page (and on the covers, if any) a title distinct
from that of the Document, and from those of previous versions
(which should, if there were any, be listed in the History section
of the Document). You may use the same title as a previous version
if the original publisher of that version gives permission.
@item
List on the Title Page, as authors, one or more persons or entities
responsible for authorship of the modifications in the Modified
Version, together with at least five of the principal authors of the
Document (all of its principal authors, if it has fewer than five),
unless they release you from this requirement.
@item
State on the Title page the name of the publisher of the
Modified Version, as the publisher.
@item
Preserve all the copyright notices of the Document.
@item
Add an appropriate copyright notice for your modifications
adjacent to the other copyright notices.
@item
Include, immediately after the copyright notices, a license notice
giving the public permission to use the Modified Version under the
terms of this License, in the form shown in the Addendum below.
@item
Preserve in that license notice the full lists of Invariant Sections
and required Cover Texts given in the Document's license notice.
@item
Include an unaltered copy of this License.
@item
Preserve the section Entitled ``History'', Preserve its Title, and add
to it an item stating at least the title, year, new authors, and
publisher of the Modified Version as given on the Title Page. If
there is no section Entitled ``History'' in the Document, create one
stating the title, year, authors, and publisher of the Document as
given on its Title Page, then add an item describing the Modified
Version as stated in the previous sentence.
@item
Preserve the network location, if any, given in the Document for
public access to a Transparent copy of the Document, and likewise
the network locations given in the Document for previous versions
it was based on. These may be placed in the ``History'' section.
You may omit a network location for a work that was published at
least four years before the Document itself, or if the original
publisher of the version it refers to gives permission.
@item
For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve
the Title of the section, and preserve in the section all the
substance and tone of each of the contributor acknowledgements and/or
dedications given therein.
@item
Preserve all the Invariant Sections of the Document,
unaltered in their text and in their titles. Section numbers
or the equivalent are not considered part of the section titles.
@item
Delete any section Entitled ``Endorsements''. Such a section
may not be included in the Modified Version.
@item
Do not retitle any existing section to be Entitled ``Endorsements'' or
to conflict in title with any Invariant Section.
@item
Preserve any Warranty Disclaimers.
@end enumerate
If the Modified Version includes new front-matter sections or
appendices that qualify as Secondary Sections and contain no material
copied from the Document, you may at your option designate some or all
@ -216,9 +276,9 @@ of these sections as invariant. To do this, add their titles to the
list of Invariant Sections in the Modified Version's license notice.
These titles must be distinct from any other section titles.
You may add a section entitled ``Endorsements'', provided it contains
You may add a section Entitled ``Endorsements'', provided it contains
nothing but endorsements of your Modified Version by various
parties--for example, statements of peer review or that the text has
parties---for example, statements of peer review or that the text has
been approved by an organization as the authoritative definition of a
standard.
@ -235,7 +295,7 @@ permission from the previous publisher that added the old one.
The author(s) and publisher(s) of the Document do not by this License
give permission to use their names for publicity for or to assert or
imply endorsement of any Modified Version.
@sp 1
@item
COMBINING DOCUMENTS
@ -244,7 +304,7 @@ License, under the terms defined in section 4 above for modified
versions, provided that you include in the combination all of the
Invariant Sections of all of the original documents, unmodified, and
list them all as Invariant Sections of your combined work in its
license notice.
license notice, and that you preserve all their Warranty Disclaimers.
The combined work need only contain one copy of this License, and
multiple identical Invariant Sections may be replaced with a single
@ -255,12 +315,12 @@ author or publisher of that section if known, or else a unique number.
Make the same adjustment to the section titles in the list of
Invariant Sections in the license notice of the combined work.
In the combination, you must combine any sections entitled ``History''
in the various original documents, forming one section entitled
``History''; likewise combine any sections entitled ``Acknowledgements'',
and any sections entitled ``Dedications.'' You must delete all sections
entitled ``Endorsements.''
@sp 1
In the combination, you must combine any sections Entitled ``History''
in the various original documents, forming one section Entitled
``History''; likewise combine any sections Entitled ``Acknowledgements'',
and any sections Entitled ``Dedications''. You must delete all
sections Entitled ``Endorsements.''
@item
COLLECTIONS OF DOCUMENTS
@ -274,25 +334,27 @@ You may extract a single document from such a collection, and distribute
it individually under this License, provided you insert a copy of this
License into the extracted document, and follow this License in all
other respects regarding verbatim copying of that document.
@sp 1
@item
AGGREGATION WITH INDEPENDENT WORKS
A compilation of the Document or its derivatives with other separate
and independent documents or works, in or on a volume of a storage or
distribution medium, does not as a whole count as a Modified Version
of the Document, provided no compilation copyright is claimed for the
compilation. Such a compilation is called an ``aggregate'', and this
License does not apply to the other self-contained works thus compiled
with the Document, on account of their being thus compiled, if they
are not themselves derivative works of the Document.
distribution medium, is called an ``aggregate'' if the copyright
resulting from the compilation is not used to limit the legal rights
of the compilation's users beyond what the individual works permit.
When the Document is included in an aggregate, this License does not
apply to the other works in the aggregate which are not themselves
derivative works of the Document.
If the Cover Text requirement of section 3 is applicable to these
copies of the Document, then if the Document is less than one quarter
of the entire aggregate, the Document's Cover Texts may be placed on
covers that surround only the Document within the aggregate.
Otherwise they must appear on covers around the whole aggregate.
@sp 1
copies of the Document, then if the Document is less than one half of
the entire aggregate, the Document's Cover Texts may be placed on
covers that bracket the Document within the aggregate, or the
electronic equivalent of covers if the Document is in electronic form.
Otherwise they must appear on printed covers that bracket the whole
aggregate.
@item
TRANSLATION
@ -302,11 +364,18 @@ Replacing Invariant Sections with translations requires special
permission from their copyright holders, but you may include
translations of some or all Invariant Sections in addition to the
original versions of these Invariant Sections. You may include a
translation of this License provided that you also include the
original English version of this License. In case of a disagreement
between the translation and the original English version of this
License, the original English version will prevail.
@sp 1
translation of this License, and all the license notices in the
Document, and any Warranty Disclaimers, provided that you also include
the original English version of this License and the original versions
of those notices and disclaimers. In case of a disagreement between
the translation and the original version of this License or a notice
or disclaimer, the original version will prevail.
If a section in the Document is Entitled ``Acknowledgements'',
``Dedications'', or ``History'', the requirement (section 4) to Preserve
its Title (section 1) will typically require changing the actual
title.
@item
TERMINATION
@ -317,7 +386,7 @@ automatically terminate your rights under this License. However,
parties who have received copies, or rights, from you under this
License will not have their licenses terminated so long as such
parties remain in full compliance.
@sp 1
@item
FUTURE REVISIONS OF THIS LICENSE
@ -325,7 +394,7 @@ The Free Software Foundation may publish new, revised versions
of the GNU Free Documentation License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns. See
http://www.gnu.org/copyleft/.
@uref{http://www.gnu.org/copyleft/}.
Each version of the License is given a distinguishing version number.
If the Document specifies that a particular numbered version of this
@ -335,10 +404,10 @@ of any later version that has been published (not as a draft) by the
Free Software Foundation. If the Document does not specify a version
number of this License, you may choose any version ever published (not
as a draft) by the Free Software Foundation.
@end enumerate
@unnumberedsec ADDENDUM: How to use this License for your documents
@page
@heading ADDENDUM: How to use this License for your documents
To use this License in a document you have written, include a copy of
the License in the document and put the following copyright and
@ -346,23 +415,37 @@ license notices just after the title page:
@smallexample
@group
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1
or any later version published by the Free Software Foundation;
with the Invariant Sections being @var{list their titles}, with the
Front-Cover Texts being @var{list}, and with the Back-Cover Texts being @var{list}.
A copy of the license is included in the section entitled "GNU
Free Documentation License."
Copyright (C) @var{year} @var{your name}.
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
Texts. A copy of the license is included in the section entitled ``GNU
Free Documentation License''.
@end group
@end smallexample
If you have no Invariant Sections, write ``with no Invariant Sections''
instead of saying which ones are invariant. If you have no
Front-Cover Texts, write ``no Front-Cover Texts'' instead of
``Front-Cover Texts being @var{list}''; likewise for Back-Cover Texts.
If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
replace the ``with@dots{}Texts.'' line with this:
@smallexample
@group
with the Invariant Sections being @var{list their titles}, with
the Front-Cover Texts being @var{list}, and with the Back-Cover Texts
being @var{list}.
@end group
@end smallexample
If you have Invariant Sections without Cover Texts, or some other
combination of the three, merge those two alternatives to suit the
situation.
If your document contains nontrivial examples of program code, we
recommend releasing these examples in parallel under your choice of
free software license, such as the GNU General Public License,
to permit their use in free software.
@c Local Variables:
@c ispell-local-pdict: "ispell-dict"
@c End:

View File

@ -8,11 +8,11 @@
@cindex conventions for makefiles
@cindex standards for makefiles
@c Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001 Free
@c Software Foundation, Inc.
@c Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 2000, 2001,
@c 2004, 2005, 2006 Free Software Foundation, Inc.
@c Permission is granted to copy, distribute and/or modify this document
@c under the terms of the GNU Free Documentation License, Version 1.1
@c under the terms of the GNU Free Documentation License, Version 1.2
@c or any later version published by the Free Software Foundation;
@c with no Invariant Sections, with no
@c Front-Cover Texts, and with no Back-Cover Texts.
@ -36,11 +36,12 @@ Using Automake will help you write a Makefile that follows these
conventions.
@menu
* Makefile Basics:: General Conventions for Makefiles
* Utilities in Makefiles:: Utilities in Makefiles
* Command Variables:: Variables for Specifying Commands
* Directory Variables:: Variables for Installation Directories
* Standard Targets:: Standard Targets for Users
* Makefile Basics:: General conventions for Makefiles.
* Utilities in Makefiles:: Utilities to be used in Makefiles.
* Command Variables:: Variables for specifying commands.
* DESTDIR:: Supporting staged installs.
* Directory Variables:: Variables for installation directories.
* Standard Targets:: Standard targets for users.
* Install Command Categories:: Three categories of commands in the `install'
rule: normal, pre-install and post-install.
@end menu
@ -263,43 +264,102 @@ Every Makefile should also define the variables @code{INSTALL_PROGRAM}
and @code{INSTALL_DATA}. (The default for @code{INSTALL_PROGRAM} should
be @code{$(INSTALL)}; the default for @code{INSTALL_DATA} should be
@code{$@{INSTALL@} -m 644}.) Then it should use those variables as the
commands for actual installation, for executables and nonexecutables
respectively. Use these variables as follows:
commands for actual installation, for executables and non-executables
respectively. Minimal use of these variables is as follows:
@example
$(INSTALL_PROGRAM) foo $(bindir)/foo
$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
@end example
Optionally, you may prepend the value of @code{DESTDIR} to the target
filename. Doing this allows the installer to create a snapshot of the
installation to be copied onto the real target filesystem later. Do not
set the value of @code{DESTDIR} in your Makefile, and do not include it
in any installed files. With support for @code{DESTDIR}, the above
examples become:
@example
$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
@end example
However, it is preferable to support a @code{DESTDIR} prefix on the
target files, as explained in the next section.
@noindent
Always use a file name, not a directory name, as the second argument of
the installation commands. Use a separate command for each file to be
installed.
@node DESTDIR
@section @code{DESTDIR}: support for staged installs
@vindex DESTDIR
@cindex staged installs
@cindex installations, staged
@code{DESTDIR} is a variable prepended to each installed target file,
like this:
@example
$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
@end example
The @code{DESTDIR} variable is specified by the user on the @code{make}
command line. For example:
@example
make DESTDIR=/tmp/stage install
@end example
@noindent
@code{DESTDIR} should be supported only in the @code{install*} and
@code{uninstall*} targets, as those are the only targets where it is
useful.
If your installation step would normally install
@file{/usr/local/bin/foo} and @file{/usr/local/lib/libfoo.a}, then an
installation invoked as in the example above would install
@file{/tmp/stage/usr/local/bin/foo} and
@file{/tmp/stage/usr/local/lib/libfoo.a} instead.
Prepending the variable @code{DESTDIR} to each target in this way
provides for @dfn{staged installs}, where the installed files are not
placed directly into their expected location but are instead copied
into a temporary location (@code{DESTDIR}). However, installed files
maintain their relative directory structure and any embedded file names
will not be modified.
You should not set the value of @code{DESTDIR} in your @file{Makefile}
at all; then the files are installed into their expected locations by
default. Also, specifying @code{DESTDIR} should not change the
operation of the software in any way, so its value should not be
included in any file contents.
@code{DESTDIR} support is commonly used in package creation. It is
also helpful to users who want to understand what a given package will
install where, and to allow users who don't normally have permissions
to install into protected areas to build and install before gaining
those permissions. Finally, it can be useful with tools such as
@code{stow}, where code is installed in one place but made to appear
to be installed somewhere else using symbolic links or special mount
operations. So, we strongly recommend GNU packages support
@code{DESTDIR}, though it is not an absolute requirement.
@node Directory Variables
@section Variables for Installation Directories
Installation directories should always be named by variables, so it is
easy to install in a nonstandard place. The standard names for these
variables are described below. They are based on a standard filesystem
layout; variants of it are used in SVR4, 4.4BSD, GNU/Linux, Ultrix v4,
and other modern operating systems.
variables and the values they should have in GNU packages are
described below. They are based on a standard file system layout;
variants of it are used in GNU/Linux and other modern operating
systems.
These two variables set the root for the installation. All the other
installation directories should be subdirectories of one of these two,
and nothing should be directly installed into these two directories.
Installers are expected to override these values when calling
@command{make} (e.g., @kbd{make prefix=/usr install} or
@command{configure} (e.g., @kbd{configure --prefix=/usr}). GNU
packages should not try to guess which value should be appropriate for
these variables on the system they are being installed onto: use the
default settings specified here so that all GNU packages behave
identically, allowing the installer to achieve any desired layout.
These first two variables set the root for the installation. All the
other installation directories should be subdirectories of one of
these two, and nothing should be directly installed into these two
directories.
@table @code
@item prefix
@ -355,6 +415,12 @@ The directory for installing executable programs to be run by other
programs 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, so
you should install your data in a subdirectory thereof. Most packages
install 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 table
Data files used by the program during its execution are divided into
@ -377,17 +443,32 @@ discourage the use of architecture-dependent files, aside from object
files and libraries. It is much cleaner to make other data files
architecture-independent, and it is generally not hard.
Therefore, here are the variables Makefiles should use to specify
directories:
Here are the variables Makefiles should use to specify directories
to put these various kinds of files in:
@table @samp
@item datarootdir
The root of the directory tree for read-only architecture-independent
data files. This should normally be @file{/usr/local/share}, but
write it as @file{$(prefix)/share}. (If you are using Autoconf, write
it as @samp{@@datarootdir@@}.) @samp{datadir}'s default value is
based on this variable; so are @samp{infodir}, @samp{mandir}, and
others.
@item datadir
The directory for installing read-only architecture independent data
files. This should normally be @file{/usr/local/share}, but write it as
@file{$(prefix)/share}.
(If you are using Autoconf, write it as @samp{@@datadir@@}.)
As a special exception, see @file{$(infodir)}
and @file{$(includedir)} below.
The directory for installing idiosyncratic read-only
architecture-independent data files for this program. This is usually
the same place as @samp{datarootdir}, but we use the two separate
variables so that you can move these program-specific files without
altering 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 you
should install your data in a subdirectory thereof. Most packages
install their data under @file{$(datadir)/@var{package-name}/}.
@item sysconfdir
The directory for installing read-only data files that pertain to a
@ -419,34 +500,14 @@ in @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 table
@item libdir
The directory for object files and libraries of object code. Do not
install 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 infodir
The directory for installing the Info files for this package. By
default, it should be @file{/usr/local/info}, but it should be written
as @file{$(prefix)/info}.
(If you are using Autoconf, write it as @samp{@@infodir@@}.)
@item lispdir
The directory for installing any Emacs Lisp files in this package. By
default, it should be @file{/usr/local/share/emacs/site-lisp}, but it
should be written as @file{$(prefix)/share/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 lines
in your @file{configure.in} file:
@example
lispdir='$@{datadir@}/emacs/site-lisp'
AC_SUBST(lispdir)
@end example
These variables specify the directory for installing certain specific
types of files, if your program has them. Every GNU package should
have Info files, so every program needs @samp{infodir}, but not all
need @samp{libdir} or @samp{lispdir}.
@table @samp
@item includedir
@c rewritten to avoid overfull hbox --roland
The directory for installing header files to be included by user
@ -481,6 +542,62 @@ package.
To tell whether @file{foo.h} came from the Foo package, put a magic
string in the file---part of a comment---and @code{grep} for that string.
@item docdir
The directory for installing documentation files (other than Info) for
this 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, which
may include a version number, prevents collisions among files with
common names, such as @file{README}.
@item infodir
The directory for installing the Info files for this package. By
default, it should be @file{/usr/local/share/info}, but it should be
written 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 psdir
Directories for installing documentation files in the particular
format. They should all be set to @code{$(docdir)} by default. (If
you are using Autoconf, write them as @samp{@@htmldir@@},
@samp{@@dvidir@@}, etc.) Packages which supply several translations
of 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 libdir
The directory for object files and libraries of object code. Do not
install 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 lispdir
The directory for installing any Emacs Lisp files in this package. By
default, it should be @file{/usr/local/share/emacs/site-lisp}, but it
should 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 lines
in your @file{configure.in} file:
@example
lispdir='$@{datarootdir@}/emacs/site-lisp'
AC_SUBST(lispdir)
@end example
@item localedir
The directory for installing locale-specific message catalogs for this
package. By default, it should be @file{/usr/local/share/locale}, but
it should be written as @file{$(datarootdir)/locale}. (If you are
using Autoconf, write it as @samp{@@localedir@@}.) This directory
usually has a subdirectory per locale.
@end table
Unix-style man pages are installed in one of the following:
@ -488,9 +605,9 @@ Unix-style man pages are installed in one of the following:
@table @samp
@item mandir
The top-level directory for installing the man pages (if any) for this
package. It will normally be @file{/usr/local/man}, but you should
write it as @file{$(prefix)/man}.
(If you are using Autoconf, write it as @samp{@@mandir@@}.)
package. It will normally be @file{/usr/local/share/man}, but you
should write it as @file{$(datarootdir)/man}. (If you are using
Autoconf, write it as @samp{@@mandir@@}.)
@item man1dir
The directory for installing section 1 man pages. Write it as
@ -524,7 +641,7 @@ And finally, you should set the following variable:
@item srcdir
The directory for the sources being compiled. The value of this
variable is normally inserted by the @code{configure} shell script.
(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.)
(If you are using Autoconf, use @samp{srcdir = @@srcdir@@}.)
@end table
For example:
@ -535,13 +652,15 @@ For example:
# Common prefix for installation directories.
# NOTE: This directory must exist when you start the install.
prefix = /usr/local
datarootdir = $(prefix)/share
datadir = $(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 = $(prefix)/info
infodir = $(datarootdir)/info
@end smallexample
If your program installs a large number of files into one of the
@ -556,6 +675,15 @@ specify the exact same values for several different GNU packages. In
order for this to be useful, all the packages must be designed so that
they will work sensibly when the user does so.
At times, not all of these variables may be implemented in the current
release of Autoconf and/or Automake; but as of Autoconf@tie{}2.60, we
believe all of them are. When any are missing, the descriptions here
serve as specifications for what Autoconf will implement. As a
programmer, you can either use a development version of Autoconf or
avoid using these variables until a stable release is made which
supports them.
@node Standard Targets
@section Standard Targets for Users
@ -565,8 +693,9 @@ All GNU programs should have the following targets in their Makefiles:
@item all
Compile the entire program. This should be the default target. This
target need not rebuild any documentation files; Info files should
normally be included in the distribution, and DVI files should be made
only when explicitly asked for.
normally be included in the distribution, and DVI (and other
documentation format) files should be made only when explicitly asked
for.
By default, the Make rules should compile and link with @samp{-g}, so
that executable programs have debugging symbols. Users who don't mind
@ -605,7 +734,7 @@ menu 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.
@comment Please do not reformat it without talking to bug-make@gnu.org.
@smallexample
$(DESTDIR)$(infodir)/foo.info: foo.info
$(POST_INSTALL)
@ -630,9 +759,31 @@ commands into three categories: normal ones, @dfn{pre-installation}
commands and @dfn{post-installation} commands. @xref{Install Command
Categories}.
@item install-html
@itemx install-dvi
@itemx install-pdf
@itemx install-ps
These targets install documentation in formats other than Info;
they're intended to be called explicitly by the person installing the
package, if that format is desired. GNU prefers Info files, so these
must be installed by the @code{install} target.
When you have many documentation files to install, we recommend that
you avoid collisions and clutter by arranging for these targets to
install in subdirectories of the appropriate installation directory,
such as @code{htmldir}. As one example, if your package has multiple
manuals, and you wish to install HTML documentation with many files
(such as the ``split'' mode output by @code{makeinfo --html}), you'll
certainly want to use subdirectories, or two nodes with the same name
in different manuals will overwrite each other.
Please make these @code{install-@var{format}} targets invoke the
commands for the @var{format} target, for example, by making
@var{format} a dependency.
@item uninstall
Delete all the installed files---the copies that the @samp{install}
target creates.
and @samp{install-*} targets create.
This rule should not modify the directories where compilation is done,
only the directories where files are installed.
@ -668,18 +819,24 @@ executable elsewhere in case there is a bug.
@comment in the printed Make manual. Please leave it in.
@item clean
Delete all files from the current directory that are normally created by
building the program. Don't delete the files that record the
configuration. Also preserve files that could be made by building, but
normally aren't because the distribution comes with them.
Delete all files in the current directory that are normally created by
building the program. Also delete files in other directories if they
are created by this makefile. However, don't delete the files that
record the configuration. Also preserve files that could be made by
building, but normally aren't because the distribution comes with
them. There is no need to delete parent directories that were created
with @samp{mkdir -p}, since they could have existed anyway.
Delete @file{.dvi} files here if they are not part of the distribution.
@item distclean
Delete all files from the current directory that are created by
configuring or building the program. If you have unpacked the source
and built the program without creating any other files, @samp{make
distclean} should leave only the files that were in the distribution.
Delete all files in the current directory (or created by this
makefile) that are created by configuring or building the program. If
you have unpacked the source and built the program without creating
any other files, @samp{make distclean} should leave only the files
that were in the distribution. However, there is no need to delete
parent directories that were created with @samp{mkdir -p}, since they
could have existed anyway.
@item mostlyclean
Like @samp{clean}, but may refrain from deleting a few files that people
@ -688,18 +845,21 @@ target for GCC does not delete @file{libgcc.a}, because recompiling it
is rarely necessary and takes a lot of time.
@item maintainer-clean
Delete almost everything from the current directory that can be
reconstructed with this Makefile. This typically includes everything
deleted by @code{distclean}, plus more: C source files produced by
Bison, tags tables, Info files, and so on.
Delete almost everything that can be reconstructed with this Makefile.
This typically includes everything deleted by @code{distclean}, plus
more: C source files produced by Bison, tags tables, Info files, and
so on.
The reason we say ``almost everything'' is that running the command
@samp{make maintainer-clean} should not delete @file{configure} even if
@file{configure} can be remade using a rule in the Makefile. More generally,
@samp{make maintainer-clean} should not delete anything that needs to
exist in order to run @file{configure} and then begin to build the
program. This is the only exception; @code{maintainer-clean} should
delete everything else that can be rebuilt.
@samp{make maintainer-clean} should not delete @file{configure} even
if @file{configure} can be remade using a rule in the Makefile. More
generally, @samp{make maintainer-clean} should not delete anything
that needs to exist in order to run @file{configure} and then begin to
build the program. Also, there is no need to delete parent
directories that were created with @samp{mkdir -p}, since they could
have existed anyway. These are the only exceptions;
@code{maintainer-clean} should delete everything else that can be
rebuilt.
The @samp{maintainer-clean} target is intended to be used by a maintainer of
the package, not by ordinary users. You may need special tools to
@ -743,8 +903,15 @@ users build the package, ordinarily Make will not update the Info files
because they will already be up to date.
@item dvi
Generate DVI files for all Texinfo documentation.
For example:
@itemx html
@itemx pdf
@itemx ps
Generate documentation files in the given format. These targets
should always exist, but any or all can be a no-op if the given output
format cannot be generated. These targets should not be dependencies
of the @code{all} target; the user must manually invoke them.
Here's an example rule for generating DVI files from Texinfo:
@smallexample
dvi: foo.dvi
@ -760,6 +927,20 @@ distribution.@footnote{@code{texi2dvi} uses @TeX{} to do the real work
of formatting. @TeX{} is not distributed with Texinfo.} Alternatively,
write just the dependencies, and allow GNU @code{make} to provide the command.
Here's another example, this one for generating HTML from Texinfo:
@smallexample
html: foo.html
foo.html: foo.texi chap1.texi chap2.texi
$(TEXI2HTML) $(srcdir)/foo.texi
@end smallexample
@noindent
Again, you would define the variable @code{TEXI2HTML} in the Makefile;
for example, it might run @code{makeinfo --no-split --html}
(@command{makeinfo} is part of the Texinfo distribution).
@item dist
Create a distribution tar file for this program. The tar file should be
set up so that the file names in the tar file start with a subdirectory
@ -932,10 +1113,12 @@ execute the pre-installation and post-installation commands.
Programs to build binary packages work by extracting the
pre-installation and post-installation commands. Here is one way of
extracting the pre-installation commands:
extracting the pre-installation commands (the @option{-s} option to
@command{make} is needed to silence messages about entering
subdirectories):
@smallexample
make -n install -o all \
make -s -n install -o all \
PRE_INSTALL=pre-install \
POST_INSTALL=post-install \
NORMAL_INSTALL=normal-install \
@ -946,10 +1129,7 @@ make -n install -o all \
where the file @file{pre-install.awk} could contain this:
@smallexample
$0 ~ /^\t[ \t]*(normal_install|post_install)[ \t]*$/ @{on = 0@}
$0 ~ /^(normal-install|post-install)[ \t]*$/ @{on = 0@}
on @{print $0@}
$0 ~ /^\t[ \t]*pre_install[ \t]*$/ @{on = 1@}
$0 ~ /^pre-install[ \t]*$/ @{on = 1@}
@end smallexample
The resulting file of pre-installation commands is executed as a shell
script as part of installing the binary package.

File diff suppressed because it is too large Load Diff