    The top level Makefile will automatically build all libraries placed in
directories of the form lib.+ and then all programs in subdirectories of the
programs directory.  In order for this to work correctly, certain files and make
targets are required.

    Each library must provide Make.header and Make.files in its top level
directory.  The first target in Make.header must be "default," and must build
the static and shared (if J_BUILD_SHARED_LIB is defined) versions of the
library.  Make.header must also provide the target "Makefiles" to build the
Makefiles in any subdirectories.  (e.g. the Makefile for the test suite)
Make.header should also define "tidy" and "clean" as double colon targets to
clean up any subdirectories.  (e.g. the test suite)  The source distribution
should also include a symbolic link placed in the include directory that points
to the library's header files and symbolic links placed in the lib directory
that point to the static and shared versions of the library in the library's top
level directory.  The JParser and J3D libraries provide examples of how to do
all this.

    Each program must also provide Make.header and Make.files in its top level
directory.  In this case, Make.header must provide the target "Makefiles" to
build the Makefiles in any subdirectories, the target "jxinstall" to build the
program, strip it, and place it in ${JX_INSTALL_ROOT}/, and the target
"jxuninstall" to remove the program from ${JX_INSTALL_ROOT}/.  For the user's
convenience, the first target in Make.header should be "default," and should
build first the required libraries and then the program.  It is also helpful to
provide a target "static" to build a statically linked version of the binary.
In order to make it easy for others to build binary distributions for other
platforms, Make.header should also define the targets "shared" and "link" to
build the tar file containing the dynamically linked executable and link-kit tar
file, respectively.  If there are any subdirectories with their own Makefiles,
Make.header should define "tidy" and "clean" as double colon targets to clean up
these subdirectories.  Code Crusader provides an example of how to do all this.

    While studying the example Make.header files, you will notice that they
include the files include/make/constants and include/make/config.
include/make/constants defines system independent constants needed for the
various required targets, such as J_DISTR_TAR_DIR which is discussed below.  It
also defines ljcore, ljx, etc. which expand to the appropriate -l arguments for
use in the make variable LOADLIBES.  include/make/constants requires that
JX_ROOT be defined.  include/make/config defines system dependent constants.  Of
particular interest is J_BUILD_SHARED_LIB which should be used in the
Make.header for every library to decide whether or not to build the shared
version.

    For the user's maximal convenience and to insure that incompatible versions
never get linked together, all libraries and programs should be packaged from
above the main JX directory, defined in the variable J_DISTR_TAR_DIR.  This way,
the user can download the source to all the libraries and programs, unpack them
all in the same directory, and then build them all with a single make.