4.2.3 Construction Variables

Construction variables are values assigned to keys within an Environment. Construction variables are used by Builders to produce output files. See Default Construction Variables for a reference of all built-in construction variables.

Example:

build do
  Environment.new do |env|
    env["CCFLAGS"] += %w[-O2 -Wall]
    env["LIBS"] += %w[m]
  end
end

This example modifies the CCFLAGS construction variable to add -O2 and -Wall to the compilation commands used for C and C++ source files. It also instructs the linker to link against the m library.

4.2.3.1 Construction Variable Naming

  • uppercase strings - the default construction variables that Rscons uses
  • strings beginning with "_" - set and used internally by builders
  • symbols, lowercase strings - reserved as user-defined construction variables