XEmacs 21.2.46 "Urania".
[chise/xemacs-chise.git.1] / man / make-stds.texi
index 746dca5..68faa8d 100644 (file)
@@ -81,7 +81,7 @@ foo.1 : foo.man sedscript
 
 @noindent
 will fail when the build directory is not the source directory, because
-@file{foo.man} and @file{sedscript} are in the the source directory.
+@file{foo.man} and @file{sedscript} are in the source directory.
 
 When using GNU @code{make}, relying on @samp{VPATH} to find the source
 file will work in the case where there is a single dependency file,
@@ -249,9 +249,10 @@ Every Makefile should define the variable @code{INSTALL}, which is the
 basic command for installing a file into the system.
 
 Every Makefile should also define the variables @code{INSTALL_PROGRAM}
-and @code{INSTALL_DATA}.  (The default for each of these should be
-@code{$(INSTALL)}.)  Then it should use those variables as the commands
-for actual installation, for executables and nonexecutables
+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:
 
 @example
@@ -282,26 +283,28 @@ installed.
 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, Linux, Ultrix v4, and
-other modern operating systems.
+layout; variants of it are used in SVR4, 4.4BSD, GNU/Linux, Ultrix v4,
+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.
 
-@table @samp
+@table @code
 @item prefix
+@vindex prefix
 A prefix used in constructing the default values of the variables listed
 below.  The default value of @code{prefix} should be @file{/usr/local}.
 When building the complete GNU system, the prefix will be empty and
 @file{/usr} will be a symbolic link to @file{/}.
 (If you are using Autoconf, write it as @samp{@@prefix@@}.)
 
-Running @samp{make install} with a different value of @code{prefix}
-from the one used to build the program should @var{not} recompile
-the program.
+Running @samp{make install} with a different value of @code{prefix} from
+the one used to build the program should @emph{not} recompile the
+program.
 
 @item exec_prefix
+@vindex exec_prefix
 A prefix used in constructing the default values of some of the
 variables listed below.  The default value of @code{exec_prefix} should
 be @code{$(prefix)}.
@@ -312,20 +315,22 @@ machine-specific files (such as executables and subroutine libraries),
 while @code{$(prefix)} is used directly for other directories.
 
 Running @samp{make install} with a different value of @code{exec_prefix}
-from the one used to build the program should @var{not} recompile the
+from the one used to build the program should @emph{not} recompile the
 program.
 @end table
 
 Executable programs are installed in one of the following directories.
 
-@table @samp
+@table @code
 @item bindir
+@vindex bindir
 The directory for installing executable programs that users can run.
 This should normally be @file{/usr/local/bin}, but write it as
 @file{$(exec_prefix)/bin}.
 (If you are using Autoconf, write it as @samp{@@bindir@@}.)
 
 @item sbindir
+@vindex sbindir
 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 @file{/usr/local/sbin}, but write it as
@@ -333,6 +338,7 @@ should normally be @file{/usr/local/sbin}, but write it as
 (If you are using Autoconf, write it as @samp{@@sbindir@@}.)
 
 @item libexecdir
+@vindex libexecdir
 @comment This paragraph adjusted to avoid overfull hbox --roland 5jul94
 The directory for installing executable programs to be run by other
 programs rather than by users.  This directory should normally be
@@ -507,7 +513,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 Autoconf, use @samp{srcdir = @@srcdir@@}.)
+(If you are using Autconf, use @samp{srcdir = @@srcdir@@}.)
 @end table
 
 For example:
@@ -625,7 +631,8 @@ the installation commands.  @xref{Install Command Categories}.
 
 @item install-strip
 Like @code{install}, but strip the executable files while installing
-them.  In many cases, the definition of this target can be very simple:
+them.  In simple cases, this target can use the @code{install} target in
+a simple way:
 
 @smallexample
 install-strip:
@@ -633,6 +640,14 @@ install-strip:
                 install
 @end smallexample
 
+But if the package installs scripts as well as real executables, the
+@code{install-strip} target can't just refer to the @code{install}
+target; it has to strip the executables but not the scripts.
+
+@code{install-strip} should not strip the executables in the build
+directory which are being copied for installation.  It should only strip
+the copies that are installed.
+
 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
@@ -747,7 +762,7 @@ The easiest way to do this is to create a subdirectory appropriately
 named, use @code{ln} or @code{cp} to install the proper files in it, and
 then @code{tar} that subdirectory.
 
-Compress the tar file file with @code{gzip}.  For example, the actual
+Compress the tar file with @code{gzip}.  For example, the actual
 distribution file for GCC version 1.40 is called @file{gcc-1.40.tar.gz}.
 
 The @code{dist} target should explicitly depend on all non-source files
@@ -795,6 +810,19 @@ installdirs: mkinstalldirs
                                 $(mandir)
 @end smallexample
 
+@noindent
+or, if you wish to support @env{DESTDIR},
+
+@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)
+@end smallexample
+
 This rule should not modify the directories where compilation is done.
 It should do nothing but create installation directories.
 @end table