ct-build¶
One-command Make-specific wrapper around ct-findtargets + make¶
- Author:
- Date:
2025-11-26
- Version:
10.0.6
- Manual section:
1
- Manual group:
developers
SYNOPSIS¶
ct-build [CT-FINDTARGETS OPTIONS] [CT-CREATE-MAKEFILE OPTIONS]
DESCRIPTION¶
ct-build is a Make-specific convenience front-end that chains the usual
steps needed to compile a project with compiletools:
ct-findtargets --style=argsis run with all user-supplied arguments to discover buildable executables and tests.ct-create-makefileis invoked with the discovered targets plus the same argument list to produce an up-to-date Makefile.make -j$(ct-jobs)executes the generated Makefile using the job count calculated byct-jobs(which honorsct.confandCT_JOBS).
For other build backends (Ninja, CMake, Bazel, Shake), use
ct-cake --backend=<name> instead.
Because every flag is passed through untouched, you can use the exact same
options you would normally hand to ct-findtargets or ct-create-makefile
(e.g., --variant, --magic, --append-CXXFLAGS, --cas-objdir,
--bindir). The wrapper simply glues those tools together and ensures the
parallel make step uses the recommended level of concurrency.
OPTIONS¶
ct-build does not define its own bespoke flags; it accepts the combined
option set of ct-findtargets and ct-create-makefile. Frequently used
examples include:
--variant VARIANTChoose the build variant (debug, release, etc.). Defaults to
blank.--auto/--no-autoEnable or disable automatic target discovery. Auto mode is on by default.
--magic {direct,cpp}Select magic include processing strategy passed through to ct-cake logic.
--makefilename PATHOverride the location of the intermediate Makefile.
--cas-objdir PATH/--bindir PATHOverride where objects and binaries are written.
See the manuals for ct-findtargets and ct-create-makefile for the
complete option reference.
ENVIRONMENT¶
CT_JOBSIf set, overrides the job count returned by
ct-jobsfor the finalmakeinvocation. Otherwisect-jobsuses CPU count and config data.ct.confSettings such as include paths, object CAS directives, and variant defaults influence every stage that ct-build orchestrates.
EXAMPLES¶
Build everything in the current tree using the release variant:
ct-build --variant=release
Compile with automatic magic flag detection disabled and custom output dirs:
ct-build --no-auto --cas-objdir=out/obj --bindir=out/bin
SEE ALSO¶
ct-findtargets (1), ct-create-makefile (1), ct-cake (1), ct-jobs (1)