clearmake.options

clearmake build options specification (BOS) file

Applicability

Product

Command type

VersionVault

data structure

Platform

UNIX®

Linux®

Windows®

Synopsis

One or more files read by clearmake, specifying make macros and special targets.

Description

Note: The distinctive features of clearmake, such as build auditing, derived object sharing, and build avoidance, are supported in dynamic views only. In addition, parallel building is supported in HCL VersionVault snapshot views.

A build options specification (BOS) file is a text file that contains macro definitions and/or VersionVault special targets. Place temporary macros (such as CFLAGS=-g (UNIX® and Linux®) or CFLAGS=/Zi (Windows®) and others that you do not want to include in a makefile permanently) in a BOS file, rather than specifying them on the clearmake command line.

By default, clearmake reads BOS files in this order:

  1. The default BOS files:
    1. The file .clearmake.options in your home directory (as indicated in the password database (UNIX® and Linux®) or by the HOME environment variable or in the user profile (Windows®). This is the place for macros to be used every time you execute clearmake.
    2. One or more local BOS files, each of which corresponds to one of the makefiles specified with a -f option or read automatically by clearmake. Each BOS file has a name in the form makefile-name.options. For example:
      • makefile.options
      • Makefile.options
      • project.mk.options
  2. BOS files in the CCASE_OPTS_SPECS environment variable.
  3. BOS files specified on the command line with -A.

If you specify -N, clearmake does not read default BOS files.

clearmake displays the names of the BOS files it reads if you specify the -v or -d option, or if CCASE_VERBOSITY is set to 1.

The following sections describe the various kinds of BOS file entries.

Standard macro definitions

A standard macro definition has the same form as a make macro defined in a makefile:

macro_name = string

For example:

CDEBUGFLAGS = -g (UNIX and Linux)
CDEBUGFLAGS = /Zi (Windows)

Target-dependent macro definitions

A target-dependent macro definition takes this form:

target-list := macro_name = string

Any standard macro definition can follow the := operator; the definition takes effect only when targets in target-list and their dependencies are processed. Targets in the target-list must be separated by white space. For example:

foo.o bar.o := CDEBUGFLAGS=-g (UNIX and Linux)
foo.o bar.o := CDEBUGFLAGS=/Zi (Windows)

Two or more higher-level targets can have a common dependency. If the targets have different target-dependent macro definitions, the dependency is built using the macros for the first higher-level target that clearmake considered building (whether or not clearmake actually built it).

Shell command macro definitions

A shell command macro definition replaces a macro name with the output of a shell command:

macro_name :sh = string

This defines the value of macro_name to be the output of string, an arbitrary shell command. In command output, <NL> characters are replaced by <SPACE> characters. For example:

BUILD_DATE :sh = date (UNIX and Linux)
NT_VER :sh = VER (Windows)

Note: This syntax does not work in makefiles when you are using default compatibility mode.

Special targets

You can use the following VersionVault special targets in a build options spec:

.DEPENDENCY_IGNORED_FOR_REUSE
.INCREMENTAL_REPOSITORY_SIBLING
.INCREMENTAL_TARGET
.NO_CMP_NON_MF_DEPS
.NO_CMP_SCRIPT
.NO_CONFIG_REC
.NO_DO_FOR_SIBLING
.NO_WINK_IN
.SIBLING_IGNORED_FOR_REUSE
.SIBLINGS_AFFECT_REUSE

On UNIX® and Linux® only, you can also use

.NOTPARALLEL

For descriptions of these targets, see the makefile_ccase reference page.

Include directives

To include one BOS file in another, use the include or sinclude (silent include) directive. For example, on UNIX® or Linux®:

include /usr/local/lib/ux.options
sinclude $(OPTS_DIR)/clearmake.options

On Windows®:

include \lib\aux.options
sinclude $(OPTS_DIR)\clearmake.options

Comments

A BOS file can contain comment lines, which begin with a pound sign (#) character.

Make macros and environment variables

By default, the order of precedence of macros and environment variables is as follows:

  1. Target-dependent macro definitions
  2. Macros specified on the clearmake command line
  3. Make macros set in a BOS file
  4. Make macro definitions in a makefile
  5. Environment variables

For example, target-dependent macro definitions override all other macro definitions, and macros specified on the clearmake command line override those set in a BOS file.

If you use the -e option to clearmake, environment variables override macro definitions in the makefile.

All BOS file macros (except those overridden on the command line) are placed in the build script's environment. If a build script recursively invokes clearmake:

  • The higher-level BOS file setting (now transformed into an EV) is overridden by a make macro set in the lower-level makefile. However, if the recursive invocation uses the -e option, the BOS file setting prevails.
  • If another BOS file (associated with another makefile) is read at the lower level, its make macros override those from the higher-level BOS file.