Chapter 15: Makefile Conventions 155
the next reboot. PID files for system daemons are a typical use. In addition,
this directory should not be cleaned except perhaps at reboot, while the general
/tmp (TMPDIR) may be cleaned arbitrarily. This should normally be /var/run,
but write it as $(localstatedir)/run. Having it as a separate variable allows
the use of /run if desired, for example. (If you are using Autoconf 2.70 or later,
write it as ‘@runstatedir@’.)
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
‘infodir’, but not all need ‘libdir’ or ‘lispdir’.
‘includedir’
The directory for installing header files to be included by user programs
with the C ‘#include’ preprocessor directive. This should normally be
/usr/local/include, but write it as $(prefix)/include. (If you are using
Autoconf, write it as ‘@includedir@’.)
Most compilers other than GCC do not look for header files in directory
/usr/local/include. 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 includedir and one specified by oldincludedir.
‘oldincludedir’
The directory for installing ‘#include’ header files for use with compilers other
than GCC. This should normally be /usr/include. (If you are using Autoconf,
you can write it as ‘@oldincludedir@’.)
The Makefile commands should check whether the value of oldincludedir is
empty. If it is, they should not try to use it; they should cancel the second
installation of the header files.
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 foo.h, then it should install the header file in the oldincludedir
directory if either (1) there is no foo.h there or (2) the foo.h that exists came
from the Foo package.
To tell whether foo.h came from the Foo package, put a magic string in the
file—part of a comment—and grep for that string.
‘docdir’ The directory for installing documentation files (other than Info) for this pack-
age. By default, it should be /usr/local/share/doc/yourpkg, but it should
be written as $(datarootdir)/doc/yourpkg. (If you are using Autoconf, write
it as ‘@docdir@’.) The yourpkg subdirectory, which may include a version num-
ber, prevents collisions among files with common names, such as README.
‘infodir’ The directory for installing the Info files for this package. By default,
it should be /usr/local/share/info, but it should be written as
$(datarootdir)/info. (If you are using Autoconf, write it as ‘@infodir@’.)
infodir is separate from docdir for compatibility with existing practice.
Comentários a estes Manuais