automake: Alternative

1 
1 7.3 An Alternative Approach to Subdirectories
1 =============================================
1 
1 If you’ve ever read Peter Miller’s excellent paper, Recursive Make
1 Considered Harmful (http://miller.emu.id.au/pmiller/books/rmch/), the
1 preceding sections on the use of make recursion will probably come as
1 unwelcome advice.  For those who haven’t read the paper, Miller’s main
1 thesis is that recursive ‘make’ invocations are both slow and
1 error-prone.
1 
1    Automake provides sufficient cross-directory support (1) to enable
1 you to write a single ‘Makefile.am’ for a complex multi-directory
1 package.
1 
1    By default an installable file specified in a subdirectory will have
1 its directory name stripped before installation.  For instance, in this
1 example, the header file will be installed as ‘$(includedir)/stdio.h’:
1 
1      include_HEADERS = inc/stdio.h
1 
1    However, the ‘nobase_’ prefix can be used to circumvent this path
1 stripping.  In this example, the header file will be installed as
1 ‘$(includedir)/sys/types.h’:
1 
1      nobase_include_HEADERS = sys/types.h
1 
1    ‘nobase_’ should be specified first when used in conjunction with
1 either ‘dist_’ or ‘nodist_’ (⇒Fine-grained Distribution Control).
1 For instance:
1 
1      nobase_dist_pkgdata_DATA = images/vortex.pgm sounds/whirl.ogg
1 
1    Finally, note that a variable using the ‘nobase_’ prefix can often be
11 replaced by several variables, one for each destination directory (⇒
 Uniform).  For instance, the last example could be rewritten as
1 follows:
1 
1      imagesdir = $(pkgdatadir)/images
1      soundsdir = $(pkgdatadir)/sounds
1      dist_images_DATA = images/vortex.pgm
1      dist_sounds_DATA = sounds/whirl.ogg
1 
1 This latter syntax makes it possible to change one destination directory
1 without changing the layout of the source tree.
1 
1    Currently, ‘nobase_*_LTLIBRARIES’ are the only exception to this
1 rule, in that there is no particular installation order guarantee for an
1 otherwise equivalent set of variables without ‘nobase_’ prefix.
1 
1    ---------- Footnotes ----------
1 
1    (1) We believe.  This work is new and there are probably warts.
1 ⇒Introduction, for information on reporting bugs.
1