--- make-doc-non-dfsg-3.81.orig/doc/make/make_14.html
+++ make-doc-non-dfsg-3.81/doc/make/make_14.html
@@ -0,0 +1,1237 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
+<html>
+<!-- This file documents the GNU make utility, which determines
+automatically which pieces of a large program need to be recompiled,
+and issues the commands to recompile them.
+
+This is Edition 0.70, last updated 1 April 2006,
+of The GNU Make Manual, for GNU make version 3.81.
+
+Copyright C 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006
+Free Software Foundation, Inc.
+
+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, with the Front-Cover Texts being "A GNU Manual,"
+and with the Back-Cover Texts as in (a) below. A copy of the
+license is included in the section entitled "GNU Free Documentation
+License."
+
+(a) The FSF's Back-Cover Text is: "You have freedom to copy and modify
+this GNU Manual, like GNU software. Copies published by the Free
+Software Foundation raise funds for GNU development."
+
+ -->
+<!-- Created on August, 17 2009 by texi2html 1.78 -->
+<!--
+Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
+ Karl Berry <karl@freefriends.org>
+ Olaf Bachmann <obachman@mathematik.uni-kl.de>
+ and many others.
+Maintained by: Many creative people.
+Send bugs and suggestions to <texi2html-bug@nongnu.org>
+
+-->
+<head>
+<title>GNU make: 14. Makefile Conventions</title>
+
+<meta name="description" content="GNU make: 14. Makefile Conventions">
+<meta name="keywords" content="GNU make: 14. Makefile Conventions">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="Generator" content="texi2html 1.78">
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<style type="text/css">
+<!--
+a.summary-letter {text-decoration: none}
+pre.display {font-family: serif}
+pre.format {font-family: serif}
+pre.menu-comment {font-family: serif}
+pre.menu-preformatted {font-family: serif}
+pre.smalldisplay {font-family: serif; font-size: smaller}
+pre.smallexample {font-size: smaller}
+pre.smallformat {font-family: serif; font-size: smaller}
+pre.smalllisp {font-size: smaller}
+span.roman {font-family:serif; font-weight:normal;}
+span.sansserif {font-family:sans-serif; font-weight:normal;}
+ul.toc {list-style: none}
+-->
+</style>
+
+
+</head>
+
+<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
+
+<a name="Makefile-Conventions"></a>
+<a name="SEC136"></a>
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="make_13.html#SEC135" title="Previous section in reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC137" title="Next section in reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make_13.html#SEC135" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Up section"> Up </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<h1 class="chapter"> 14. Makefile Conventions </h1>
+
+
+
+<p>This
+describes conventions for writing the Makefiles for GNU programs.
+Using Automake will help you write a Makefile that follows these
+conventions.
+</p>
+<table class="menu" border="0" cellspacing="0">
+<tr><td align="left" valign="top"><a href="#SEC137">14.1 General Conventions for Makefiles</a></td><td> </td><td align="left" valign="top"></td></tr>
+<tr><td align="left" valign="top"><a href="#SEC138">14.2 Utilities in Makefiles</a></td><td> </td><td align="left" valign="top"></td></tr>
+<tr><td align="left" valign="top"><a href="#SEC139">14.3 Variables for Specifying Commands</a></td><td> </td><td align="left" valign="top"></td></tr>
+<tr><td align="left" valign="top"><a href="#SEC140">14.4 Variables for Installation Directories</a></td><td> </td><td align="left" valign="top"></td></tr>
+<tr><td align="left" valign="top"><a href="#SEC141">14.5 Standard Targets for Users</a></td><td> </td><td align="left" valign="top"></td></tr>
+<tr><td align="left" valign="top"><a href="#SEC142">14.6 Install Command Categories</a></td><td> </td><td align="left" valign="top"> Three categories of commands in the `install'
+ rule: normal, pre-install and post-install.
+</td></tr>
+</table>
+
+<hr size="6">
+<a name="Makefile-Basics"></a>
+<a name="SEC137"></a>
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#SEC136" title="Previous section in reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC138" title="Next section in reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Up section"> Up </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<h2 class="section"> 14.1 General Conventions for Makefiles </h2>
+
+<p>Every Makefile should contain this line:
+</p>
+<table><tr><td> </td><td><pre class="example">SHELL = /bin/sh
+</pre></td></tr></table>
+
+<p>to avoid trouble on systems where the <code>SHELL</code> variable might be
+inherited from the environment. (This is never a problem with GNU
+<code>make</code>.)
+</p>
+<p>Different <code>make</code> programs have incompatible suffix lists and
+implicit rules, and this sometimes creates confusion or misbehavior. So
+it is a good idea to set the suffix list explicitly using only the
+suffixes you need in the particular Makefile, like this:
+</p>
+<table><tr><td> </td><td><pre class="example">.SUFFIXES:
+.SUFFIXES: .c .o
+</pre></td></tr></table>
+
+<p>The first line clears out the suffix list, the second introduces all
+suffixes which may be subject to implicit rules in this Makefile.
+</p>
+<p>Don't assume that ‘<tt>.</tt>’ is in the path for command execution. When
+you need to run programs that are a part of your package during the
+make, please make sure that it uses ‘<tt>./</tt>’ if the program is built as
+part of the make or ‘<tt>$(srcdir)/</tt>’ if the file is an unchanging part
+of the source code. Without one of these prefixes, the current search
+path is used.
+</p>
+<p>The distinction between ‘<tt>./</tt>’ (the <em>build directory</em>) and
+‘<tt>$(srcdir)/</tt>’ (the <em>source directory</em>) is important because
+users can build in a separate directory using the ‘<samp>--srcdir</samp>’ option
+to ‘<tt>configure</tt>’. A rule of the form:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">foo.1 : foo.man sedscript
+ sed -e sedscript foo.man > foo.1
+</pre></td></tr></table>
+
+<p>will fail when the build directory is not the source directory, because
+‘<tt>foo.man</tt>’ and ‘<tt>sedscript</tt>’ are in the source directory.
+</p>
+<p>When using GNU <code>make</code>, relying on ‘<samp>VPATH</samp>’ to find the source
+file will work in the case where there is a single dependency file,
+since the <code>make</code> automatic variable ‘<samp>$<</samp>’ will represent the
+source file wherever it is. (Many versions of <code>make</code> set ‘<samp>$<</samp>’
+only in implicit rules.) A Makefile target like
+</p>
+<table><tr><td> </td><td><pre class="smallexample">foo.o : bar.c
+ $(CC) -I. -I$(srcdir) $(CFLAGS) -c bar.c -o foo.o
+</pre></td></tr></table>
+
+<p>should instead be written as
+</p>
+<table><tr><td> </td><td><pre class="smallexample">foo.o : bar.c
+ $(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@
+</pre></td></tr></table>
+
+<p>in order to allow ‘<samp>VPATH</samp>’ to work correctly. When the target has
+multiple dependencies, using an explicit ‘<samp>$(srcdir)</samp>’ is the easiest
+way to make the rule work well. For example, the target above for
+‘<tt>foo.1</tt>’ is best written as:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">foo.1 : foo.man sedscript
+ sed -e $(srcdir)/sedscript $(srcdir)/foo.man > $@
+</pre></td></tr></table>
+
+<p>GNU distributions usually contain some files which are not source
+files—for example, Info files, and the output from Autoconf, Automake,
+Bison or Flex. Since these files normally appear in the source
+directory, they should always appear in the source directory, not in the
+build directory. So Makefile rules to update them should put the
+updated files in the source directory.
+</p>
+<p>However, if a file does not appear in the distribution, then the
+Makefile should not put it in the source directory, because building a
+program in ordinary circumstances should not modify the source directory
+in any way.
+</p>
+<p>Try to make the build and installation targets, at least (and all their
+subtargets) work correctly with a parallel <code>make</code>.
+</p>
+<hr size="6">
+<a name="Utilities-in-Makefiles"></a>
+<a name="SEC138"></a>
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#SEC137" title="Previous section in reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC139" title="Next section in reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Up section"> Up </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<h2 class="section"> 14.2 Utilities in Makefiles </h2>
+
+<p>Write the Makefile commands (and any shell scripts, such as
+<code>configure</code>) to run in <code>sh</code>, not in <code>csh</code>. Don't use any
+special features of <code>ksh</code> or <code>bash</code>.
+</p>
+<p>The <code>configure</code> script and the Makefile rules for building and
+installation should not use any utilities directly except these:
+</p>
+
+<table><tr><td> </td><td><pre class="example">cat cmp cp diff echo egrep expr false grep install-info
+ln ls mkdir mv pwd rm rmdir sed sleep sort tar test touch true
+</pre></td></tr></table>
+
+<p>The compression program <code>gzip</code> can be used in the <code>dist</code> rule.
+</p>
+<p>Stick to the generally supported options for these programs. For
+example, don't use ‘<samp>mkdir -p</samp>’, convenient as it may be, because
+most systems don't support it.
+</p>
+<p>It is a good idea to avoid creating symbolic links in makefiles, since a
+few systems don't support them.
+</p>
+<p>The Makefile rules for building and installation can also use compilers
+and related programs, but should do so via <code>make</code> variables so that the
+user can substitute alternatives. Here are some of the programs we
+mean:
+</p>
+<table><tr><td> </td><td><pre class="example">ar bison cc flex install ld ldconfig lex
+make makeinfo ranlib texi2dvi yacc
+</pre></td></tr></table>
+
+<p>Use the following <code>make</code> variables to run those programs:
+</p>
+<table><tr><td> </td><td><pre class="example">$(AR) $(BISON) $(CC) $(FLEX) $(INSTALL) $(LD) $(LDCONFIG) $(LEX)
+$(MAKE) $(MAKEINFO) $(RANLIB) $(TEXI2DVI) $(YACC)
+</pre></td></tr></table>
+
+<p>When you use <code>ranlib</code> or <code>ldconfig</code>, you should make sure
+nothing bad happens if the system does not have the program in question.
+Arrange to ignore an error from that command, and print a message before
+the command to tell the user that failure of this command does not mean
+a problem. (The Autoconf ‘<samp>AC_PROG_RANLIB</samp>’ macro can help with
+this.)
+</p>
+<p>If you use symbolic links, you should implement a fallback for systems
+that don't have symbolic links.
+</p>
+<p>Additional utilities that can be used via Make variables are:
+</p>
+<table><tr><td> </td><td><pre class="example">chgrp chmod chown mknod
+</pre></td></tr></table>
+
+<p>It is ok to use other utilities in Makefile portions (or scripts)
+intended only for particular systems where you know those utilities
+exist.
+</p>
+<hr size="6">
+<a name="Command-Variables"></a>
+<a name="SEC139"></a>
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#SEC138" title="Previous section in reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC140" title="Next section in reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Up section"> Up </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<h2 class="section"> 14.3 Variables for Specifying Commands </h2>
+
+<p>Makefiles should provide variables for overriding certain commands, options,
+and so on.
+</p>
+<p>In particular, you should run most utility programs via variables.
+Thus, if you use Bison, have a variable named <code>BISON</code> whose default
+value is set with ‘<samp>BISON = bison</samp>’, and refer to it with
+<code>$(BISON)</code> whenever you need to use Bison.
+</p>
+<p>File management utilities such as <code>ln</code>, <code>rm</code>, <code>mv</code>, and
+so on, need not be referred to through variables in this way, since users
+don't need to replace them with other programs.
+</p>
+<p>Each program-name variable should come with an options variable that is
+used to supply options to the program. Append ‘<samp>FLAGS</samp>’ to the
+program-name variable name to get the options variable name—for
+example, <code>BISONFLAGS</code>. (The names <code>CFLAGS</code> for the C
+compiler, <code>YFLAGS</code> for yacc, and <code>LFLAGS</code> for lex, are
+exceptions to this rule, but we keep them because they are standard.)
+Use <code>CPPFLAGS</code> in any compilation command that runs the
+preprocessor, and use <code>LDFLAGS</code> in any compilation command that
+does linking as well as in any direct use of <code>ld</code>.
+</p>
+<p>If there are C compiler options that <em>must</em> be used for proper
+compilation of certain files, do not include them in <code>CFLAGS</code>.
+Users expect to be able to specify <code>CFLAGS</code> freely themselves.
+Instead, arrange to pass the necessary options to the C compiler
+independently of <code>CFLAGS</code>, by writing them explicitly in the
+compilation commands or by defining an implicit rule, like this:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">CFLAGS = -g
+ALL_CFLAGS = -I. $(CFLAGS)
+.c.o:
+ $(CC) -c $(CPPFLAGS) $(ALL_CFLAGS) $<
+</pre></td></tr></table>
+
+<p>Do include the ‘<samp>-g</samp>’ option in <code>CFLAGS</code>, because that is not
+<em>required</em> for proper compilation. You can consider it a default
+that is only recommended. If the package is set up so that it is
+compiled with GCC by default, then you might as well include ‘<samp>-O</samp>’
+in the default value of <code>CFLAGS</code> as well.
+</p>
+<p>Put <code>CFLAGS</code> last in the compilation command, after other variables
+containing compiler options, so the user can use <code>CFLAGS</code> to
+override the others.
+</p>
+<p><code>CFLAGS</code> should be used in every invocation of the C compiler,
+both those which do compilation and those which do linking.
+</p>
+<p>Every Makefile should define the variable <code>INSTALL</code>, which is the
+basic command for installing a file into the system.
+</p>
+<p>Every Makefile should also define the variables <code>INSTALL_PROGRAM</code>
+and <code>INSTALL_DATA</code>. (The default for <code>INSTALL_PROGRAM</code> should
+be <code>$(INSTALL)</code>; the default for <code>INSTALL_DATA</code> should be
+<code>${INSTALL} -m 644</code>.) Then it should use those variables as the
+commands for actual installation, for executables and nonexecutables
+respectively. Use these variables as follows:
+</p>
+<table><tr><td> </td><td><pre class="example">$(INSTALL_PROGRAM) foo $(bindir)/foo
+$(INSTALL_DATA) libfoo.a $(libdir)/libfoo.a
+</pre></td></tr></table>
+
+<p>Optionally, you may prepend the value of <code>DESTDIR</code> 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</code> in your Makefile, and do not include it
+in any installed files. With support for <code>DESTDIR</code>, the above
+examples become:
+</p>
+<table><tr><td> </td><td><pre class="example">$(INSTALL_PROGRAM) foo $(DESTDIR)$(bindir)/foo
+$(INSTALL_DATA) libfoo.a $(DESTDIR)$(libdir)/libfoo.a
+</pre></td></tr></table>
+
+<p>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.
+</p>
+<hr size="6">
+<a name="Directory-Variables"></a>
+<a name="SEC140"></a>
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#SEC139" title="Previous section in reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC141" title="Next section in reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Up section"> Up </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<h2 class="section"> 14.4 Variables for Installation Directories </h2>
+
+<p>Installation directories should always be named by variables, so it is
+easy to install in a nonstandard place. The standard names for these
+variables and the values they should have in GNU packages are
+described below. They are based on a standard filesystem layout;
+variants of it are used in GNU/Linux and other modern operating
+systems.
+</p>
+<p>Installers are expected to override these values when calling
+<code>make</code> (e.g., <kbd>make prefix=/usr install</kbd> or
+<code>configure</code> (e.g., <kbd>configure --prefix=/usr</kbd>). 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.
+</p>
+<p>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.
+</p>
+<dl compact="compact">
+<dt> <code>prefix</code></dt>
+<dd><a name="IDX632"></a>
+<p>A prefix used in constructing the default values of the variables listed
+below. The default value of <code>prefix</code> should be ‘<tt>/usr/local</tt>’.
+When building the complete GNU system, the prefix will be empty and
+‘<tt>/usr</tt>’ will be a symbolic link to ‘<tt>/</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@prefix@</samp>’.)
+</p>
+<p>Running ‘<samp>make install</samp>’ with a different value of <code>prefix</code> from
+the one used to build the program should <em>not</em> recompile the
+program.
+</p>
+</dd>
+<dt> <code>exec_prefix</code></dt>
+<dd><a name="IDX633"></a>
+<p>A prefix used in constructing the default values of some of the
+variables listed below. The default value of <code>exec_prefix</code> should
+be <code>$(prefix)</code>.
+(If you are using Autoconf, write it as ‘<samp>@exec_prefix@</samp>’.)
+</p>
+<p>Generally, <code>$(exec_prefix)</code> is used for directories that contain
+machine-specific files (such as executables and subroutine libraries),
+while <code>$(prefix)</code> is used directly for other directories.
+</p>
+<p>Running ‘<samp>make install</samp>’ with a different value of <code>exec_prefix</code>
+from the one used to build the program should <em>not</em> recompile the
+program.
+</p></dd>
+</dl>
+
+<p>Executable programs are installed in one of the following directories.
+</p>
+<dl compact="compact">
+<dt> <code>bindir</code></dt>
+<dd><a name="IDX634"></a>
+<p>The directory for installing executable programs that users can run.
+This should normally be ‘<tt>/usr/local/bin</tt>’, but write it as
+‘<tt>$(exec_prefix)/bin</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@bindir@</samp>’.)
+</p>
+</dd>
+<dt> <code>sbindir</code></dt>
+<dd><a name="IDX635"></a>
+<p>The directory for installing executable programs that can be run from
+the shell, but are only generally useful to system administrators. This
+should normally be ‘<tt>/usr/local/sbin</tt>’, but write it as
+‘<tt>$(exec_prefix)/sbin</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@sbindir@</samp>’.)
+</p>
+</dd>
+<dt> <code>libexecdir</code></dt>
+<dd><a name="IDX636"></a>
+<p>The directory for installing executable programs to be run by other
+programs rather than by users. This directory should normally be
+‘<tt>/usr/local/libexec</tt>’, but write it as ‘<tt>$(exec_prefix)/libexec</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@libexecdir@</samp>’.)
+</p>
+<p>The definition of ‘<samp>libexecdir</samp>’ is the same for all packages, so
+you should install your data in a subdirectory thereof. Most packages
+install their data under ‘<tt>$(libexecdir)/<var>package-name</var>/</tt>’,
+possibly within additional subdirectories thereof, such as
+‘<tt>$(libexecdir)/<var>package-name</var>/<var>machine</var>/<var>version</var></tt>’.
+</p></dd>
+</dl>
+
+<p>Data files used by the program during its execution are divided into
+categories in two ways.
+</p>
+<ul>
+<li>
+Some files are normally modified by programs; others are never normally
+modified (though users may edit some of these).
+
+</li><li>
+Some files are architecture-independent and can be shared by all
+machines at a site; some are architecture-dependent and can be shared
+only by machines of the same kind and operating system; others may never
+be shared between two machines.
+</li></ul>
+
+<p>This makes for six different possibilities. However, we want to
+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.
+</p>
+<p>Here are the variables Makefiles should use to specify directories
+to put these various kinds of files in:
+</p>
+<dl compact="compact">
+<dt> ‘<samp>datarootdir</samp>’</dt>
+<dd><p>The root of the directory tree for read-only architecture-independent
+data files. This should normally be ‘<tt>/usr/local/share</tt>’, but
+write it as ‘<tt>$(prefix)/share</tt>’. (If you are using Autoconf, write
+it as ‘<samp>@datarootdir@</samp>’.) ‘<samp>datadir</samp>’'s default value is
+based on this variable; so are ‘<samp>infodir</samp>’, ‘<samp>mandir</samp>’, and
+others.
+</p>
+</dd>
+<dt> ‘<samp>datadir</samp>’</dt>
+<dd><p>The directory for installing idiosyncratic read-only
+architecture-independent data files for this program. This is usually
+the same place as ‘<samp>datarootdir</samp>’, 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.
+</p>
+<p>This should normally be ‘<tt>/usr/local/share</tt>’, but write it as
+‘<tt>$(datarootdir)</tt>’. (If you are using Autoconf, write it as
+‘<samp>@datadir@</samp>’.)
+</p>
+<p>The definition of ‘<samp>datadir</samp>’ is the same for all packages, so you
+should install your data in a subdirectory thereof. Most packages
+install their data under ‘<tt>$(datadir)/<var>package-name</var>/</tt>’.
+</p>
+</dd>
+<dt> ‘<samp>sysconfdir</samp>’</dt>
+<dd><p>The directory for installing read-only data files that pertain to a
+single machine–that is to say, files for configuring a host. Mailer
+and network configuration files, ‘<tt>/etc/passwd</tt>’, and so forth belong
+here. All the files in this directory should be ordinary ASCII text
+files. This directory should normally be ‘<tt>/usr/local/etc</tt>’, but
+write it as ‘<tt>$(prefix)/etc</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@sysconfdir@</samp>’.)
+</p>
+<p>Do not install executables here in this directory (they probably belong
+in ‘<tt>$(libexecdir)</tt>’ or ‘<tt>$(sbindir)</tt>’). Also do not install
+files that are modified in the normal course of their use (programs
+whose purpose is to change the configuration of the system excluded).
+Those probably belong in ‘<tt>$(localstatedir)</tt>’.
+</p>
+</dd>
+<dt> ‘<samp>sharedstatedir</samp>’</dt>
+<dd><p>The directory for installing architecture-independent data files which
+the programs modify while they run. This should normally be
+‘<tt>/usr/local/com</tt>’, but write it as ‘<tt>$(prefix)/com</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@sharedstatedir@</samp>’.)
+</p>
+</dd>
+<dt> ‘<samp>localstatedir</samp>’</dt>
+<dd><p>The directory for installing data files which the programs modify while
+they run, and that pertain to one specific machine. Users should never
+need to modify files in this directory to configure the package's
+operation; put such configuration information in separate files that go
+in ‘<tt>$(datadir)</tt>’ or ‘<tt>$(sysconfdir)</tt>’. ‘<tt>$(localstatedir)</tt>’
+should normally be ‘<tt>/usr/local/var</tt>’, but write it as
+‘<tt>$(prefix)/var</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@localstatedir@</samp>’.)
+</p></dd>
+</dl>
+
+<p>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</samp>’, but not all
+need ‘<samp>libdir</samp>’ or ‘<samp>lispdir</samp>’.
+</p>
+<dl compact="compact">
+<dt> ‘<samp>includedir</samp>’</dt>
+<dd><p>The directory for installing header files to be included by user
+programs with the C ‘<samp>#include</samp>’ preprocessor directive. This
+should normally be ‘<tt>/usr/local/include</tt>’, but write it as
+‘<tt>$(prefix)/include</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@includedir@</samp>’.)
+</p>
+<p>Most compilers other than GCC do not look for header files in directory
+‘<tt>/usr/local/include</tt>’. So installing the header files this way is
+only useful with GCC. Sometimes this is not a problem because some
+libraries are only really intended to work with GCC. But some libraries
+are intended to work with other compilers. They should install their
+header files in two places, one specified by <code>includedir</code> and one
+specified by <code>oldincludedir</code>.
+</p>
+</dd>
+<dt> ‘<samp>oldincludedir</samp>’</dt>
+<dd><p>The directory for installing ‘<samp>#include</samp>’ header files for use with
+compilers other than GCC. This should normally be ‘<tt>/usr/include</tt>’.
+(If you are using Autoconf, you can write it as ‘<samp>@oldincludedir@</samp>’.)
+</p>
+<p>The Makefile commands should check whether the value of
+<code>oldincludedir</code> is empty. If it is, they should not try to use
+it; they should cancel the second installation of the header files.
+</p>
+<p>A package should not replace an existing header in this directory unless
+the header came from the same package. Thus, if your Foo package
+provides a header file ‘<tt>foo.h</tt>’, then it should install the header
+file in the <code>oldincludedir</code> directory if either (1) there is no
+‘<tt>foo.h</tt>’ there or (2) the ‘<tt>foo.h</tt>’ that exists came from the Foo
+package.
+</p>
+<p>To tell whether ‘<tt>foo.h</tt>’ came from the Foo package, put a magic
+string in the file—part of a comment—and <code>grep</code> for that string.
+</p>
+</dd>
+<dt> ‘<samp>docdir</samp>’</dt>
+<dd><p>The directory for installing documentation files (other than Info) for
+this package. By default, it should be
+‘<tt>/usr/local/share/doc/<var>yourpkg</var></tt>’, but it should be written as
+‘<tt>$(datarootdir)/doc/<var>yourpkg</var></tt>’. (If you are using Autoconf,
+write it as ‘<samp>@docdir@</samp>’.) The <var>yourpkg</var> subdirectory, which
+may include a version number, prevents collisions among files with
+common names, such as ‘<tt>README</tt>’.
+</p>
+</dd>
+<dt> ‘<samp>infodir</samp>’</dt>
+<dd><p>The directory for installing the Info files for this package. By
+default, it should be ‘<tt>/usr/local/share/info</tt>’, but it should be
+written as ‘<tt>$(datarootdir)/info</tt>’. (If you are using Autoconf,
+write it as ‘<samp>@infodir@</samp>’.) <code>infodir</code> is separate from
+<code>docdir</code> for compatibility with existing practice.
+</p>
+</dd>
+<dt> ‘<samp>htmldir</samp>’</dt>
+<dt> ‘<samp>dvidir</samp>’</dt>
+<dt> ‘<samp>pdfdir</samp>’</dt>
+<dt> ‘<samp>psdir</samp>’</dt>
+<dd><p>Directories for installing documentation files in the particular
+format. (It is not required to support documentation in all these
+formats.) They should all be set to <code>$(docdir)</code> by default. (If
+you are using Autoconf, write them as ‘<samp>@htmldir@</samp>’,
+‘<samp>@dvidir@</samp>’, etc.) Packages which supply several translations
+of their documentation should install them in
+‘<samp>$(htmldir)/</samp>’<var>ll</var>, ‘<samp>$(pdfdir)/</samp>’<var>ll</var>, etc. where
+<var>ll</var> is a locale abbreviation such as ‘<samp>en</samp>’ or ‘<samp>pt_BR</samp>’.
+</p>
+</dd>
+<dt> ‘<samp>libdir</samp>’</dt>
+<dd><p>The directory for object files and libraries of object code. Do not
+install executables here, they probably ought to go in ‘<tt>$(libexecdir)</tt>’
+instead. The value of <code>libdir</code> should normally be
+‘<tt>/usr/local/lib</tt>’, but write it as ‘<tt>$(exec_prefix)/lib</tt>’.
+(If you are using Autoconf, write it as ‘<samp>@libdir@</samp>’.)
+</p>
+</dd>
+<dt> ‘<samp>lispdir</samp>’</dt>
+<dd><p>The directory for installing any Emacs Lisp files in this package. By
+default, it should be ‘<tt>/usr/local/share/emacs/site-lisp</tt>’, but it
+should be written as ‘<tt>$(datarootdir)/emacs/site-lisp</tt>’.
+</p>
+<p>If you are using Autoconf, write the default as ‘<samp>@lispdir@</samp>’.
+In order to make ‘<samp>@lispdir@</samp>’ work, you need the following lines
+in your ‘<tt>configure.in</tt>’ file:
+</p>
+<table><tr><td> </td><td><pre class="example">lispdir='${datarootdir}/emacs/site-lisp'
+AC_SUBST(lispdir)
+</pre></td></tr></table>
+
+</dd>
+<dt> ‘<samp>localedir</samp>’</dt>
+<dd><p>The directory for installing locale-specific message catalogs for this
+package. By default, it should be ‘<tt>/usr/local/share/locale</tt>’, but
+it should be written as ‘<tt>$(datarootdir)/locale</tt>’. (If you are
+using Autoconf, write it as ‘<samp>@localedir@</samp>’.) This directory
+usually has a subdirectory per locale.
+</p></dd>
+</dl>
+
+<p>Unix-style man pages are installed in one of the following:
+</p>
+<dl compact="compact">
+<dt> ‘<samp>mandir</samp>’</dt>
+<dd><p>The top-level directory for installing the man pages (if any) for this
+package. It will normally be ‘<tt>/usr/local/share/man</tt>’, but you
+should write it as ‘<tt>$(datarootdir)/man</tt>’. (If you are using
+Autoconf, write it as ‘<samp>@mandir@</samp>’.)
+</p>
+</dd>
+<dt> ‘<samp>man1dir</samp>’</dt>
+<dd><p>The directory for installing section 1 man pages. Write it as
+‘<tt>$(mandir)/man1</tt>’.
+</p></dd>
+<dt> ‘<samp>man2dir</samp>’</dt>
+<dd><p>The directory for installing section 2 man pages. Write it as
+‘<tt>$(mandir)/man2</tt>’
+</p></dd>
+<dt> ‘<samp>…</samp>’</dt>
+<dd>
+<p><strong>Don't make the primary documentation for any GNU software be a
+man page. Write a manual in Texinfo instead. Man pages are just for
+the sake of people running GNU software on Unix, which is a secondary
+application only.</strong>
+</p>
+</dd>
+<dt> ‘<samp>manext</samp>’</dt>
+<dd><p>The file name extension for the installed man page. This should contain
+a period followed by the appropriate digit; it should normally be ‘<samp>.1</samp>’.
+</p>
+</dd>
+<dt> ‘<samp>man1ext</samp>’</dt>
+<dd><p>The file name extension for installed section 1 man pages.
+</p></dd>
+<dt> ‘<samp>man2ext</samp>’</dt>
+<dd><p>The file name extension for installed section 2 man pages.
+</p></dd>
+<dt> ‘<samp>…</samp>’</dt>
+<dd><p>Use these names instead of ‘<samp>manext</samp>’ if the package needs to install man
+pages in more than one section of the manual.
+</p></dd>
+</dl>
+
+<p>And finally, you should set the following variable:
+</p>
+<dl compact="compact">
+<dt> ‘<samp>srcdir</samp>’</dt>
+<dd><p>The directory for the sources being compiled. The value of this
+variable is normally inserted by the <code>configure</code> shell script.
+(If you are using Autconf, use ‘<samp>srcdir = @srcdir@</samp>’.)
+</p></dd>
+</dl>
+
+<p>For example:
+</p>
+<table><tr><td> </td><td><pre class="smallexample"># 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 = $(datarootdir)/info
+</pre></td></tr></table>
+
+<p>If your program installs a large number of files into one of the
+standard user-specified directories, it might be useful to group them
+into a subdirectory particular to that program. If you do this, you
+should write the <code>install</code> rule to create these subdirectories.
+</p>
+<p>Do not expect the user to include the subdirectory name in the value of
+any of the variables listed above. The idea of having a uniform set of
+variable names for installation directories is to enable the user to
+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.
+</p>
+<hr size="6">
+<a name="Standard-Targets"></a>
+<a name="SEC141"></a>
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#SEC140" title="Previous section in reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC142" title="Next section in reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Up section"> Up </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<h2 class="section"> 14.5 Standard Targets for Users </h2>
+
+<p>All GNU programs should have the following targets in their Makefiles:
+</p>
+<dl compact="compact">
+<dt> ‘<samp>all</samp>’</dt>
+<dd><p>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.
+</p>
+<p>By default, the Make rules should compile and link with ‘<samp>-g</samp>’, so
+that executable programs have debugging symbols. Users who don't mind
+being helpless can strip the executables later if they wish.
+</p>
+</dd>
+<dt> ‘<samp>install</samp>’</dt>
+<dd><p>Compile the program and copy the executables, libraries, and so on to
+the file names where they should reside for actual use. If there is a
+simple test to verify that a program is properly installed, this target
+should run that test.
+</p>
+<p>Do not strip executables when installing them. Devil-may-care users can
+use the <code>install-strip</code> target to do that.
+</p>
+<p>If possible, write the <code>install</code> target rule so that it does not
+modify anything in the directory where the program was built, provided
+‘<samp>make all</samp>’ has just been done. This is convenient for building the
+program under one user name and installing it under another.
+</p>
+<p>The commands should create all the directories in which files are to be
+installed, if they don't already exist. This includes the directories
+specified as the values of the variables <code>prefix</code> and
+<code>exec_prefix</code>, as well as all subdirectories that are needed.
+One way to do this is by means of an <code>installdirs</code> target
+as described below.
+</p>
+<p>Use ‘<samp>-</samp>’ before any command for installing a man page, so that
+<code>make</code> will ignore any errors. This is in case there are systems
+that don't have the Unix man page documentation system installed.
+</p>
+<p>The way to install Info files is to copy them into ‘<tt>$(infodir)</tt>’
+with <code>$(INSTALL_DATA)</code> (see section <a href="#SEC139">Variables for Specifying Commands</a>), and then run
+the <code>install-info</code> program if it is present. <code>install-info</code>
+is a program that edits the Info ‘<tt>dir</tt>’ file to add or update the
+menu entry for the given Info file; it is part of the Texinfo package.
+Here is a sample rule to install an Info file:
+</p>
+<table><tr><td> </td><td><pre class="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 \
+ $(DESTDIR)$(infodir)/foo.info; \
+ else true; fi
+</pre></td></tr></table>
+
+<p>When writing the <code>install</code> target, you must classify all the
+commands into three categories: normal ones, <em>pre-installation</em>
+commands and <em>post-installation</em> commands. See section <a href="#SEC142">Install Command Categories</a>.
+</p>
+</dd>
+<dt> ‘<samp>install-html</samp>’</dt>
+<dt> ‘<samp>install-dvi</samp>’</dt>
+<dt> ‘<samp>install-pdf</samp>’</dt>
+<dt> ‘<samp>install-ps</samp>’</dt>
+<dd><p>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</code> target.
+</p>
+<p>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</code>. 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</code>), you'll
+certainly want to use subdirectories, or two nodes with the same name
+in different manuals will overwrite each other.
+</p>
+</dd>
+<dt> ‘<samp>uninstall</samp>’</dt>
+<dd><p>Delete all the installed files—the copies that the ‘<samp>install</samp>’
+and ‘<samp>install-*</samp>’ targets create.
+</p>
+<p>This rule should not modify the directories where compilation is done,
+only the directories where files are installed.
+</p>
+<p>The uninstallation commands are divided into three categories, just like
+the installation commands. See section <a href="#SEC142">Install Command Categories</a>.
+</p>
+</dd>
+<dt> ‘<samp>install-strip</samp>’</dt>
+<dd><p>Like <code>install</code>, but strip the executable files while installing
+them. In simple cases, this target can use the <code>install</code> target in
+a simple way:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">install-strip:
+ $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \
+ install
+</pre></td></tr></table>
+
+<p>But if the package installs scripts as well as real executables, the
+<code>install-strip</code> target can't just refer to the <code>install</code>
+target; it has to strip the executables but not the scripts.
+</p>
+<p><code>install-strip</code> should not strip the executables in the build
+directory which are being copied for installation. It should only strip
+the copies that are installed.
+</p>
+<p>Normally we do not recommend stripping an executable unless you are sure
+the program has no bugs. However, it can be reasonable to install a
+stripped executable for actual execution while saving the unstripped
+executable elsewhere in case there is a bug.
+</p>
+</dd>
+<dt> ‘<samp>clean</samp>’</dt>
+<dd>
+<p>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</samp>’, since they could have existed anyway.
+</p>
+<p>Delete ‘<tt>.dvi</tt>’ files here if they are not part of the distribution.
+</p>
+</dd>
+<dt> ‘<samp>distclean</samp>’</dt>
+<dd><p>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</samp>’ 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</samp>’, since they
+could have existed anyway.
+</p>
+</dd>
+<dt> ‘<samp>mostlyclean</samp>’</dt>
+<dd><p>Like ‘<samp>clean</samp>’, but may refrain from deleting a few files that people
+normally don't want to recompile. For example, the ‘<samp>mostlyclean</samp>’
+target for GCC does not delete ‘<tt>libgcc.a</tt>’, because recompiling it
+is rarely necessary and takes a lot of time.
+</p>
+</dd>
+<dt> ‘<samp>maintainer-clean</samp>’</dt>
+<dd><p>Delete almost everything that can be reconstructed with this Makefile.
+This typically includes everything deleted by <code>distclean</code>, plus
+more: C source files produced by Bison, tags tables, Info files, and
+so on.
+</p>
+<p>The reason we say “almost everything” is that running the command
+‘<samp>make maintainer-clean</samp>’ should not delete ‘<tt>configure</tt>’ even
+if ‘<tt>configure</tt>’ can be remade using a rule in the Makefile. More
+generally, ‘<samp>make maintainer-clean</samp>’ should not delete anything
+that needs to exist in order to run ‘<tt>configure</tt>’ and then begin to
+build the program. Also, there is no need to delete parent
+directories that were created with ‘<samp>mkdir -p</samp>’, since they could
+have existed anyway. These are the only exceptions;
+<code>maintainer-clean</code> should delete everything else that can be
+rebuilt.
+</p>
+<p>The ‘<samp>maintainer-clean</samp>’ target is intended to be used by a maintainer of
+the package, not by ordinary users. You may need special tools to
+reconstruct some of the files that ‘<samp>make maintainer-clean</samp>’ deletes.
+Since these files are normally included in the distribution, we don't
+take care to make them easy to reconstruct. If you find you need to
+unpack the full distribution again, don't blame us.
+</p>
+<p>To help make users aware of this, the commands for the special
+<code>maintainer-clean</code> target should start with these two:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">@echo 'This command is intended for maintainers to use; it'
+@echo 'deletes files that may need special tools to rebuild.'
+</pre></td></tr></table>
+
+</dd>
+<dt> ‘<samp>TAGS</samp>’</dt>
+<dd><p>Update a tags table for this program.
+</p>
+</dd>
+<dt> ‘<samp>info</samp>’</dt>
+<dd><p>Generate any Info files needed. The best way to write the rules is as
+follows:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">info: foo.info
+
+foo.info: foo.texi chap1.texi chap2.texi
+ $(MAKEINFO) $(srcdir)/foo.texi
+</pre></td></tr></table>
+
+<p>You must define the variable <code>MAKEINFO</code> in the Makefile. It should
+run the <code>makeinfo</code> program, which is part of the Texinfo
+distribution.
+</p>
+<p>Normally a GNU distribution comes with Info files, and that means the
+Info files are present in the source directory. Therefore, the Make
+rule for an info file should update it in the source directory. When
+users build the package, ordinarily Make will not update the Info files
+because they will already be up to date.
+</p>
+</dd>
+<dt> ‘<samp>dvi</samp>’</dt>
+<dt> ‘<samp>html</samp>’</dt>
+<dt> ‘<samp>pdf</samp>’</dt>
+<dt> ‘<samp>ps</samp>’</dt>
+<dd><p>Generate documentation files in the given format, if possible.
+Here's an example rule for generating DVI files from Texinfo:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">dvi: foo.dvi
+
+foo.dvi: foo.texi chap1.texi chap2.texi
+ $(TEXI2DVI) $(srcdir)/foo.texi
+</pre></td></tr></table>
+
+<p>You must define the variable <code>TEXI2DVI</code> in the Makefile. It should
+run the program <code>texi2dvi</code>, which is part of the Texinfo
+distribution.<a name="DOCF3" href="make_fot.html#FOOT3">(3)</a> Alternatively,
+write just the dependencies, and allow GNU <code>make</code> to provide the command.
+</p>
+<p>Here's another example, this one for generating HTML from Texinfo:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">html: foo.html
+
+foo.html: foo.texi chap1.texi chap2.texi
+ $(TEXI2HTML) $(srcdir)/foo.texi
+</pre></td></tr></table>
+
+<p>Again, you would define the variable <code>TEXI2HTML</code> in the Makefile;
+for example, it might run <code>makeinfo --no-split --html</code>
+(<code>makeinfo</code> is part of the Texinfo distribution).
+</p>
+</dd>
+<dt> ‘<samp>dist</samp>’</dt>
+<dd><p>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
+name which is the name of the package it is a distribution for. This
+name can include the version number.
+</p>
+<p>For example, the distribution tar file of GCC version 1.40 unpacks into
+a subdirectory named ‘<tt>gcc-1.40</tt>’.
+</p>
+<p>The easiest way to do this is to create a subdirectory appropriately
+named, use <code>ln</code> or <code>cp</code> to install the proper files in it, and
+then <code>tar</code> that subdirectory.
+</p>
+<p>Compress the tar file with <code>gzip</code>. For example, the actual
+distribution file for GCC version 1.40 is called ‘<tt>gcc-1.40.tar.gz</tt>’.
+</p>
+<p>The <code>dist</code> target should explicitly depend on all non-source files
+that are in the distribution, to make sure they are up to date in the
+distribution.
+See <a href="../standards/Releases.html#Releases">(standards)Releases</a> section `Making Releases' in <cite>GNU Coding Standards</cite>.
+</p>
+</dd>
+<dt> ‘<samp>check</samp>’</dt>
+<dd><p>Perform self-tests (if any). The user must build the program before
+running the tests, but need not install the program; you should write
+the self-tests so that they work when the program is built but not
+installed.
+</p></dd>
+</dl>
+
+<p>The following targets are suggested as conventional names, for programs
+in which they are useful.
+</p>
+<dl compact="compact">
+<dt> <code>installcheck</code></dt>
+<dd><p>Perform installation tests (if any). The user must build and install
+the program before running the tests. You should not assume that
+‘<tt>$(bindir)</tt>’ is in the search path.
+</p>
+</dd>
+<dt> <code>installdirs</code></dt>
+<dd><p>It's useful to add a target named ‘<samp>installdirs</samp>’ to create the
+directories where files are installed, and their parent directories.
+There is a script called ‘<tt>mkinstalldirs</tt>’ which is convenient for
+this; you can find it in the Texinfo package.
+You can use a rule like this:
+</p>
+<table><tr><td> </td><td><pre class="smallexample"># Make sure all installation directories (e.g. $(bindir))
+# actually exist by making them if necessary.
+installdirs: mkinstalldirs
+ $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
+ $(libdir) $(infodir) \
+ $(mandir)
+</pre></td></tr></table>
+
+<p>or, if you wish to support <code>DESTDIR</code>,
+</p>
+<table><tr><td> </td><td><pre class="smallexample"># Make sure all installation directories (e.g. $(bindir))
+# actually exist by making them if necessary.
+installdirs: mkinstalldirs
+ $(srcdir)/mkinstalldirs \
+ $(DESTDIR)$(bindir) $(DESTDIR)$(datadir) \
+ $(DESTDIR)$(libdir) $(DESTDIR)$(infodir) \
+ $(DESTDIR)$(mandir)
+</pre></td></tr></table>
+
+<p>This rule should not modify the directories where compilation is done.
+It should do nothing but create installation directories.
+</p></dd>
+</dl>
+
+<hr size="6">
+<a name="Install-Command-Categories"></a>
+<a name="SEC142"></a>
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#SEC141" title="Previous section in reading order"> < </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next section in reading order"> > </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="#SEC136" title="Up section"> Up </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<h2 class="section"> 14.6 Install Command Categories </h2>
+
+<p>When writing the <code>install</code> target, you must classify all the
+commands into three categories: normal ones, <em>pre-installation</em>
+commands and <em>post-installation</em> commands.
+</p>
+<p>Normal commands move files into their proper places, and set their
+modes. They may not alter any files except the ones that come entirely
+from the package they belong to.
+</p>
+<p>Pre-installation and post-installation commands may alter other files;
+in particular, they can edit global configuration files or data bases.
+</p>
+<p>Pre-installation commands are typically executed before the normal
+commands, and post-installation commands are typically run after the
+normal commands.
+</p>
+<p>The most common use for a post-installation command is to run
+<code>install-info</code>. This cannot be done with a normal command, since
+it alters a file (the Info directory) which does not come entirely and
+solely from the package being installed. It is a post-installation
+command because it needs to be done after the normal command which
+installs the package's Info files.
+</p>
+<p>Most programs don't need any pre-installation commands, but we have the
+feature just in case it is needed.
+</p>
+<p>To classify the commands in the <code>install</code> rule into these three
+categories, insert <em>category lines</em> among them. A category line
+specifies the category for the commands that follow.
+</p>
+<p>A category line consists of a tab and a reference to a special Make
+variable, plus an optional comment at the end. There are three
+variables you can use, one for each category; the variable name
+specifies the category. Category lines are no-ops in ordinary execution
+because these three Make variables are normally undefined (and you
+<em>should not</em> define them in the makefile).
+</p>
+<p>Here are the three possible category lines, each with a comment that
+explains what it means:
+</p>
+<table><tr><td> </td><td><pre class="smallexample"> $(PRE_INSTALL) # <span class="roman">Pre-install commands follow.</span>
+ $(POST_INSTALL) # <span class="roman">Post-install commands follow.</span>
+ $(NORMAL_INSTALL) # <span class="roman">Normal commands follow.</span>
+</pre></td></tr></table>
+
+<p>If you don't use a category line at the beginning of the <code>install</code>
+rule, all the commands are classified as normal until the first category
+line. If you don't use any category lines, all the commands are
+classified as normal.
+</p>
+<p>These are the category lines for <code>uninstall</code>:
+</p>
+<table><tr><td> </td><td><pre class="smallexample"> $(PRE_UNINSTALL) # <span class="roman">Pre-uninstall commands follow.</span>
+ $(POST_UNINSTALL) # <span class="roman">Post-uninstall commands follow.</span>
+ $(NORMAL_UNINSTALL) # <span class="roman">Normal commands follow.</span>
+</pre></td></tr></table>
+
+<p>Typically, a pre-uninstall command would be used for deleting entries
+from the Info directory.
+</p>
+<p>If the <code>install</code> or <code>uninstall</code> target has any dependencies
+which act as subroutines of installation, then you should start
+<em>each</em> dependency's commands with a category line, and start the
+main target's commands with a category line also. This way, you can
+ensure that each command is placed in the right category regardless of
+which of the dependencies actually run.
+</p>
+<p>Pre-installation and post-installation commands should not run any
+programs except for these:
+</p>
+<table><tr><td> </td><td><pre class="example">[ basename bash cat chgrp chmod chown cmp cp dd diff echo
+egrep expand expr false fgrep find getopt grep gunzip gzip
+hostname install install-info kill ldconfig ln ls md5sum
+mkdir mkfifo mknod mv printenv pwd rm rmdir sed sort tee
+test touch true uname xargs yes
+</pre></td></tr></table>
+
+<a name="IDX637"></a>
+<p>The reason for distinguishing the commands in this way is for the sake
+of making binary packages. Typically a binary package contains all the
+executables and other files that need to be installed, and has its own
+method of installing them—so it does not need to run the normal
+installation commands. But installing the binary package does need to
+execute the pre-installation and post-installation commands.
+</p>
+<p>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 (the ‘<samp>-s</samp>’ option to
+<code>make</code> is needed to silence messages about entering
+subdirectories):
+</p>
+<table><tr><td> </td><td><pre class="smallexample">make -s -n install -o all \
+ PRE_INSTALL=pre-install \
+ POST_INSTALL=post-install \
+ NORMAL_INSTALL=normal-install \
+ | gawk -f pre-install.awk
+</pre></td></tr></table>
+
+<p>where the file ‘<tt>pre-install.awk</tt>’ could contain this:
+</p>
+<table><tr><td> </td><td><pre class="smallexample">$0 ~ /^(normal-install|post-install)[ \t]*$/ {on = 0}
+on {print $0}
+$0 ~ /^pre-install[ \t]*$/ {on = 1}
+</pre></td></tr></table>
+
+<hr size="6">
+<table cellpadding="1" cellspacing="1" border="0">
+<tr><td valign="middle" align="left">[<a href="#SEC136" title="Beginning of this chapter or previous chapter"> << </a>]</td>
+<td valign="middle" align="left">[<a href="make_15.html#SEC143" title="Next chapter"> >> </a>]</td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left"> </td>
+<td valign="middle" align="left">[<a href="make.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
+<td valign="middle" align="left">[<a href="make_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
+<td valign="middle" align="left">[<a href="make_19.html#SEC148" title="Index">Index</a>]</td>
+<td valign="middle" align="left">[<a href="make_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
+</tr></table>
+<p>
+ <font size="-1">
+ This document was generated by <em>Manoj Srivastava</em> on <em>August, 17 2009</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78</em></a>.
+ </font>
+ <br>
+
+</p>
+</body>
+</html>