Skip to content

Latest commit

 

History

History
86 lines (56 loc) · 3.07 KB

make.md

File metadata and controls

86 lines (56 loc) · 3.07 KB

XModule Reference: make

Build external sources with make

Generally, you'll need to generate a Makefile from an external configuration tool.

Makefile generators

Main target rules

  • xbuild
    When given a Makefile source (directly or indirectly), make will build external sources. The target that this rule names is the directory and repository in which this build occurs

  • xdist
    When given an XBUILD repository source generated from a Makefile, make will install the external sources binaries, libraries, headers, and, or whichever actions it performs into the configured installation target directory. The target that this rule names is that installation directory and repository

Features

XModule

For all make derived XBUILD and XDIST targets the following list of documented features are relevant.

XBUILD

Control make build actions of the XBUILD derived types: XMAKE_SRC_BUILD and XMAKE_EXO_BUILD with properties based on these features:

  • <xmake-env> VAR=value
    set environment variable VAR to value

  • <xbuild-arg> ARG
    ARG passed to make plainly When not set, make receives no argument, taking default action

  • <xbuild-jobs> N
    Passed to make with the -j flag
    Defaults to a value proportional to invoked boost.build executable's -j value

XDIST

Control make install actions of the XDIST derived type XMAKE_DIST with properties based on these features:

  • <xdist-arg> ARG
    ARG passed to make plainly
    When not set, make receives an install argument

  • <xdist-jobs> N
    Passed to make as the -j flag
    Defaults to 1
    When N has the value: %default%, make will receive a -j flag which has the same value as default for <xbuild-jobs> feature

  • <xdist-location>
    Control location of 'xdist' directory. TODO: Document & Test

  • <xdist-staged> no | yes
    If yes, use DESTDIR={xdist-directory} as argument to make
    Defaults to no

Notes

Logs

  • workspace/log/make-build.log
  • workspace/log/make-install.log

Serialization

XBUILD and XDIST actions execute in serial by using a JAM_SEMAPHORE. This mitigates CPU, memory and other resource utilization.

Boost.Build Type Reference

Type Base Type Infer from source file Generate from Notes
XMAKEFILE base type
XMAKEFILE_SRC XMAKEFILE Makefile source Makefile (not generated)
XMAKEFILE_EXO XMAKEFILE Makefile Generators generated Makefile
XMAKE_SRC_BUILD XBUILD XMAKEFILE_SRC build in source directory
XMAKE_EXO_BUILD XBUILD XMAKEFILE_EXO build out-of-source in clean build directory
XMAKE_DIST XDIST XMAKE_SRC_BUILD | XMAKE_EXO_BUILD