build.h

Go to the documentation of this file.
00001 /*
00002  * build.h
00003  *
00004  * Bogus header for doxygen documentation.  Do not use this!
00005  */
00006 
00007 /// \ingroup dev_guide
00008 /// \defgroup build Wavepacket Build System
00009 ///
00010 /// The build system used by the Wavepacket family of source repositories
00011 /// (wavepacket-lib, wave-glut, wave-audio, aesop, folium).
00012 ///
00013 /// This home-grown build system came out of
00014 /// early attempts to get recursive and dependent builds working, plus my
00015 /// initial stabs at Perl programming.
00016 ///
00017 /// Eventually, this system should be replaced by an open source standard
00018 /// build system.  But this is used for now.
00019 ///
00020 /// Features of the wavepacket build system:
00021 ///  - <b>Separate directories for source and object files.</b>  So when you build,
00022 ///     your source directory stays clean.  Object files (and other build
00023 ///     artifacts) are put in dedicated directories in a parallel tree.
00024 ///
00025 ///  - <b>Support for dependent modules.</b>  So if you build an application that
00026 ///     depends on multiple libraries, those will be built and linked in
00027 ///     the correct dependency order.  Also, the dependencies are recursive.
00028 ///     So if you create an application that declares a dependency on library
00029 ///     A, and library A declares a dependency on library B, when you build
00030 ///     your application the build system will also build and link both
00031 ///     libraries.
00032 ///
00033 ///  - <b>Support for cross-repository builds.</b>  This is necessary because I have
00034 ///     multiple projects, each with their own SVN repository, that depend on
00035 ///     each other.
00036 ///
00037 ///  - <b>Support for GNU autoconf packages.</b>  That is, you can use the build
00038 ///     system to create distributable tar'd packages that support autoconf
00039 ///     and automake.  This is obviously handy to create versioned public
00040 ///     releases.
00041 ///
00042 /// GNU Autoconf support is primitive for now, but I will update it over time.
00043 ///
00044 /// To use the build system, any buildable object (application or library) must
00045 /// supply two files: a config file (named "config") and a Makefile (named
00046 /// "Makefile").  I thought of the names myself.
00047 ///
00048 /// A buildable object must be in its own directory.  A given directory can only
00049 /// contain a single object (library or application).
00050 ///
00051 /// The build system does make one assumption: all of your repositories are
00052 /// listed as peers in the same parent directory.  For instance, I've got an
00053 /// svn directory that contains both wavepacket-lib and folio as child
00054 /// directories.  As a developer, it is up to you to acquire local versions of
00055 /// necessary repositories.
00056 ///
00057 /// The build system will create an "obj" directory within each repository, and
00058 /// all object files and other build output for modules in that repository will
00059 /// be contained in that obj directory.  The obj/bin directory contains
00060 /// "installed" versions of applications (applications and tools will
00061 /// automatically copy their built executable to obj/bin), so
00062 /// it is a clean directory to use for executing built binaries.
00063 ///
00064 /// \n
00065 /// It is also possible to build resources into a binary as part of the build
00066 /// system.  See \ref common_resources .
00067 ///
00068 /*@{*/
00069 
00070 ////////////////////////////////////////////////////////////////////////////////
00071 ///
00072 /// \defgroup build_Makefile Build System Makefiles
00073 ///
00074 /// The Makefile is very basic: it is standard GNU makefile format.  It has to
00075 /// declare three variables:
00076 ///  - THIS_REPO: the name of the repository that the given directory is in.
00077 ///     Examples are "wavepacket-lib" or "folio".
00078 ///  - BUILD_DIR: relative path to the build directory.
00079 ///  - MODULE: the module specification (type and name).  Examples are
00080 ///     "[LIB]/graph" for a library named "graph", or "[APP]/folium" for an
00081 ///     application named "folium".
00082 ///
00083 /// There is an additional optional variable the Makefile can declare:
00084 ///  - DEPEND_REPOS: other repositories upon which this module depends.  This
00085 ///     is a comma-separated list of repository names (no spaces!).
00086 ///
00087 /// Finally, the Makefile includes the main build file default.inc (in the
00088 /// build directory), and that does the heavy lifting.
00089 ///
00090 /// To build a module (library or application) just cd to the relevant
00091 /// directory, and type:
00092 /// \code
00093 ///     % make [target]
00094 /// \endcode
00095 ///
00096 /// There are 4 supported build targets:
00097 ///  - all : (this is the default).  This makes this module and all
00098 ///     dependencies.  If the current module is an application, it will also
00099 ///     be linked.
00100 ///
00101 ///  - clean : a "make clean" will delete all object files for this module.
00102 ///
00103 ///  - nuke : a "make nuke" will recursively delete all object files for this
00104 ///     module and all of its dependencies.
00105 ///
00106 ////////////////////////////////////////////////////////////////////////////////
00107 
00108 
00109 ////////////////////////////////////////////////////////////////////////////////
00110 ///
00111 /// \defgroup build_config Build System Config files
00112 ///
00113 /// The second file is the config file.  This is purely a data file, it
00114 /// contains only key/value pairs.  (Actually it is a recursive hash, see
00115 /// Hash.pm.  However, the build system doesn't need any of the nested
00116 /// structure, so the file is essentially flat key/value pairs).
00117 ///
00118 /// A key value pair must be contained on a single line.  The format is this:
00119 /// \code
00120 ///     key     value
00121 /// \endcode
00122 ///
00123 /// That is, a key and a value separated by whitespace.  The key will be the
00124 /// first contiguous token found on the line.  The value is everything else,
00125 /// with leading and trailing whitespace removed.
00126 ///
00127 /// Common key/value pairs you should declare:
00128 ///
00129 /// Source files are declared with the "source" key.
00130 /// \code
00131 ///     source          myfile.cpp
00132 /// \endcode
00133 ///
00134 /// Dependent packages are declared with the "dependency" key.
00135 /// \code
00136 ///     dependency      [LIB]/somelib
00137 ///     dependency      [LIB]/some/other/lib
00138 /// \endcode
00139 ///
00140 /// If you need to build MOC files (an annoying artifact of the QT library),
00141 /// use the "moc" key.
00142 /// \code
00143 ///     moc             myfile.moc
00144 /// \endcode
00145 /// There is an additional messiness with .moc files: you'll need to \#include
00146 /// the .moc file in your .cpp file.  And that means your .cpp file must know
00147 /// about the output object directory.  See vgfx-widget or folium (in the
00148 /// folium project/repository) for examples.
00149 ///
00150 ////////////////////////////////////////////////////////////////////////////////