CTBUILD: Integration with SRT

D. Adams
18dec98 1620


CTBUILD is intended to act both as lightweight stand-alone build environment and as a component within the with the SRT (SoftRelTools) environment. The latter is motivated by the following:

Here we describe how CTBUILD is and will be integrated with various aspects of SRT.

User interface

CTBUILD is completely integrated into the SRT user interface. Before building any packages using ctbuild, one must do "gmake ctbuild.all" to set up the ctbuild installation. The packages using ctbuild are then built in the usual manner by invoking gmake with the standard SRT targets.

Product installation directories

CTBUILD under SRT installs and finds products (libraries, objects, and binaries) in the directories used by SRT. D0 requires some headers to be constructed at build time (for D0OM). These are put in the tmp directory searched by SRT.

Architecture-specific commands and rules

CTBUILD isolates its architecture-specific commands and switches in a make fragment which is created when the ctbuild installation is set up. This file is copied from a file whose name is inferred using the environmental variable BFARCH. This fragment includes SRT arch_spec.mk and use its definitions for commands and switches for generating dependencies, compiling and linking.

Build rules and dependencies

CTBUILD provides its own rules for building and for dependencies. There are rules for building a library, bare objects and binaries and for carrying out component and integrated tests. It also defines dependencies including those on the input sources and instruction files.

SRT defines rules and dependencies for building libraries, objects and binaries but these are not in a form conveniently shared by CTBUILD. If this changes, we could use those rules.

External products

SRT provides arch_spec files for accessing external products (those outside the SRT build structure). Again these are not easily used by CTBUILD and these are handled independently. We would like to find a way to make a common set of definitions.

Build instructions

Of course CTBUILD takes its instructions from CTEST instruction files instead of GNUmakefiles. The package's top-level GNUmakefile need only include a line including the CTBUILD controlling make fragment.

Package directory traversal

SRT traverses all active directories (those containing GNUmakefiles) each time a build target is invoked. CTBUILD creates a makefile for each target in a package and traverses the active directories (as specified by SUBDIRS instructions) only when building these makefiles. The makefiles have dependencies on appropriate instructions so they are rebuilt when these files are changed.


adams@physics.rice.edu