PeerHood build, configure and porting system

PeerHood_core (and maybe other projects) contains one level directory structure for building simplicity. Sub level directiories are modules that contain source code or other artifacts that are build to result/ directory. Build process can use build/ directory to procuce temporary files, like object or dependency files.

For PeerHood_core initial information see README.txt.

The first build system is implemented by gnumake.

Build system objectives

  • One-level directory structure: shows directly contents of the software.
  • Result based division.

Build functionalities

  1. Make c++ translation unit (TU) file dependencies to included files.
  2. Prepare result/include/peerhood include directory
  3. Compile a shared library from c++ source files.
  4. Make needed directory structure for result and build files.
  5. Clean result and build files (opposite to make all build).

Strcture

PeeHood_core/        - project
  Makefile           - top level Makefile
  MakeCommonDefs.mk  - common definitions
  MakeCommonRules.mk - common rules
  libpeerhood/       - module libpeerhood
    Makefile         - module Makefile: own definitions and rules
    ..  
  peerhoodd/         - module peerhoodd
    Makefile         - module Makefile: own definitions and rules
    ..
  otherModule/       - other modules
    Makefile         - module Makefile: own definitions and rules
    ..
  result/            - result directory, ready to install
  build/             - temporary build files
  ..

See PeerHood_core about more detailed peerhood contents.

Project top Makefile

Project top level Makefile just dispatches make targets to the module Makefiles.

Module Makefile

Module Makefile has four parts in effect.

  1. Common definitions included from ../MakeCommonDefs.mk
  2. Module own definitions
  3. Common rules included from ../MakeCommonRules.mk
  4. Module own rules

Although GNU Make execution is based on depth-first traversal of dependency graph, the order of definitions and rules is markable, therefore these parts.

Build targets

> make help
Make targets:
  build        - build all
  clean        - clean results
  install      - install results [not implemented]
  check        - run test cases [no impl]
  help         - this help [default]
  

Target phases:

  • target-do:
  • target-pre:
  • target-post: