Jam based build system - pnowell/LibPhil GitHub Wiki

The build system that LibPhil employs is based on the Jam build tool with a completely custom jam base.

  • Features
    • Supports multiple build platforms and multiple build targets
    • Auto detects which libraries a particular application needs to link against
      • This is implemented by recursively tracing all the files included form the application's source files and determining what library each file is a part of
    • All generated files are saved to a parallel directory. This does a few things:
      • Keeps the source directories clean
      • Facilitates different build targets, by putting all of their generated files into separate directories
      • Makes cleaning a particular target trivial in that you can always just delete the entire generated directory structure for that target since it can be entirely rebuilt.
    • Has a LaTeX build pipeline
      • Supports embedding SVG diagrams without having to manually convert the SVG to another format (just one more SVGDiagrams rule call in the jamfile)
    • Supports a "source zip" feature that will zip up all the source necessary to compile any given executable and place it in a parallel _zip directory (under the same directory structure as src, in the location of that executable's main directory)
  • Process
    • It requires one environment variable LIBPHIL_BASEDIR to be set to the base directory (the one that includes "src" and "jamcore")
    • The jamcore directory contains the bulk of the build system logic
    • Each directory should have a very simple Jamfile.jam file that tags that directory as something to process
    • When invoking "jam" you can set a few simple variables with jam's -s command line argument
      • LIBPHIL_CWD : The base directory to build from (you don't have to always compile your entire src directory)
      • LIBPHIL_TARGETPLAT : The platform you want to compile for
      • LIBPHIL_BUILDTYPE : debug, release, etc
      • LIBPHIL_ZIPSRC : if set to true it will zip the source for any executable it sees and place it in an _zip directory structure
    • Making a new application is as simple as
      • Put the source code in a directory somewhere in src (src/samples is a good place for them)
      • Create a file called Jamfile.jam in that same directory with the one line
        Executable [ SourceList ] ;
      • This will grab all the CPP files in the directory, compile them and follow their includes to see what libraries they need
⚠️ **GitHub.com Fallback** ⚠️