automake: Uniform
1
1 3.3 The Uniform Naming Scheme
1 =============================
1
1 Automake variables generally follow a “uniform naming scheme” that makes
1 it easy to decide how programs (and other derived objects) are built,
1 and how they are installed. This scheme also supports ‘configure’ time
1 determination of what should be built.
1
1 At ‘make’ time, certain variables are used to determine which objects
1 are to be built. The variable names are made of several pieces that are
1 concatenated together.
1
1 The piece that tells ‘automake’ what is being built is commonly
1 called the “primary”. For instance, the primary ‘PROGRAMS’ holds a list
1 of programs that are to be compiled and linked.
1
1 A different set of names is used to decide where the built objects
1 should be installed. These names are prefixes to the primary, and they
1 indicate which standard directory should be used as the installation
1 directory. The standard directory names are given in the GNU standards
1 (⇒(standards)Directory Variables). Automake extends this list
1 with ‘pkgdatadir’, ‘pkgincludedir’, ‘pkglibdir’, and ‘pkglibexecdir’;
1 these are the same as the non-‘pkg’ versions, but with ‘$(PACKAGE)’
1 appended. For instance, ‘pkglibdir’ is defined as
1 ‘$(libdir)/$(PACKAGE)’.
1
1 For each primary, there is one additional variable named by
1 prepending ‘EXTRA_’ to the primary name. This variable is used to list
1 objects that may or may not be built, depending on what ‘configure’
1 decides. This variable is required because Automake must statically
1 know the entire list of objects that may be built in order to generate a
1 ‘Makefile.in’ that will work in all cases.
1
1 For instance, ‘cpio’ decides at configure time which programs should
1 be built. Some of the programs are installed in ‘bindir’, and some are
1 installed in ‘sbindir’:
1
1 EXTRA_PROGRAMS = mt rmt
1 bin_PROGRAMS = cpio pax
1 sbin_PROGRAMS = $(MORE_PROGRAMS)
1
1 Defining a primary without a prefix as a variable, e.g., ‘PROGRAMS’,
1 is an error.
1
1 Note that the common ‘dir’ suffix is left off when constructing the
1 variable names; thus one writes ‘bin_PROGRAMS’ and not
1 ‘bindir_PROGRAMS’.
1
1 Not every sort of object can be installed in every directory.
1 Automake will flag those attempts it finds in error (but see below how
1 to override the check if you really need to). Automake will also
1 diagnose obvious misspellings in directory names.
1
1 Sometimes the standard directories—even as augmented by Automake—are
1 not enough. In particular it is sometimes useful, for clarity, to
1 install objects in a subdirectory of some predefined directory. To this
1 end, Automake allows you to extend the list of possible installation
1 directories. A given prefix (e.g., ‘zar’) is valid if a variable of the
1 same name with ‘dir’ appended is defined (e.g., ‘zardir’).
1
1 For instance, the following snippet will install ‘file.xml’ into
1 ‘$(datadir)/xml’.
1
1 xmldir = $(datadir)/xml
1 xml_DATA = file.xml
1
1 This feature can also be used to override the sanity checks Automake
1 performs to diagnose suspicious directory/primary couples (in the
1 unlikely case these checks are undesirable, and you really know what
1 you’re doing). For example, Automake would error out on this input:
1
1 # Forbidden directory combinations, automake will error out on this.
1 pkglib_PROGRAMS = foo
1 doc_LIBRARIES = libquux.a
1
1 but it will succeed with this:
1
1 # Work around forbidden directory combinations. Do not use this
1 # without a very good reason!
1 my_execbindir = $(pkglibdir)
1 my_doclibdir = $(docdir)
1 my_execbin_PROGRAMS = foo
1 my_doclib_LIBRARIES = libquux.a
1
1 The ‘exec’ substring of the ‘my_execbindir’ variable lets the files
1 be installed at the right time (⇒The Two Parts of Install).
1
1 The special prefix ‘noinst_’ indicates that the objects in question
1 should be built but not installed at all. This is usually used for
1 objects required to build the rest of your package, for instance static
1 libraries (⇒A Library), or helper scripts.
1
1 The special prefix ‘check_’ indicates that the objects in question
1 should not be built until the ‘make check’ command is run. Those
1 objects are not installed either.
1
1 The current primary names are ‘PROGRAMS’, ‘LIBRARIES’, ‘LTLIBRARIES’,
1 ‘LISP’, ‘PYTHON’, ‘JAVA’, ‘SCRIPTS’, ‘DATA’, ‘HEADERS’, ‘MANS’, and
1 ‘TEXINFOS’.
1
1 Some primaries also allow additional prefixes that control other
1 aspects of ‘automake’’s behavior. The currently defined prefixes are
1 ‘dist_’, ‘nodist_’, ‘nobase_’, and ‘notrans_’. These prefixes are
DONTPRINTYET 1 explained later (⇒Program and Library Variables) (*noteMan
1DONTPRINTYET 1 explained later (⇒Program and Library Variables) (⇒Man
Pages).
1