A configuration file defines a configuration for a project, rather than specifying an ordered set of steps for a build. Unlike makefiles, from which a make process is driven by ordered dependencies based on targets, most configuration file directives establish a relationship between source files and target files.
When you build, VisualAge C++ processes directives in a configuration file. Targets are built incrementally, and building targets drives the build process. Target directives name the output files. Source directives supplied as subdirectives of a target directive list the source files to use to create the target file. These files determine whether C++ incremental compile, C compile, link, resource bind, or other actions are performed during the build process.
Option directives apply options to the source and target files. The set of sources and options can be built up before and within the target directive. Options that are in effect when the target directive is processed, and that apply to the files used to produce the target file, are passed to the processes that operate on those files.
For example, the directives below forward options that apply to C source files and to the target executable to the C compiler and the linker. The group directive creates a group name for the source files. When the source and target directives are processed, the options defined as sourceopts and targetopts are applied to the source and target files. Options that have no meaning for the target and source file types are ignored. In this example, any source options that are specific to C++ source files, resources, or any types of files other than C source files are ignored. Any target options that do not apply to executable targets are also ignored.
option sourceopts = /* ... */
option targetopts = /* ... */
group MySourceList = myprog.c, myfunc1.c, myfunc2.c
option sourceopts, targetopts {
target myprog.exe { source MySourceList }
}
If an option is specified more than once for the same files, second and subsequent uses of the option either append to the value of the setting or reset the option, depending on the option. Similarly, some options implicitly set or override others.
Some steps in the build process do not require a target directive to be activated. Build extensions add capabilities to the build process that are not necessarily driven by target directives. To use a build extension specify a source file that the build extension processes in a source directive, or use a tool directive. The description of each build extension tells you what types of source files they are associated with, and how to prepare your configuration file to use them.
Other factors can alter the order in which directives in configuration files are handled:
Example of a Configuration File
![]()
Projects
Configuration Files
Codestore
Build Extensions and Extension Specification
Files
![]()
Add or Change Source
Files
Add or Change Targets
Change a Build Setup
Build
![]()
Configuration File Syntax
Configuration File Directives
Build Options
Build Extensions Supplied with
VisualAge C++
