target Configuration File Directive

The target directive specifies a file to be produced by a build. This directive must have subdirectives. The target file is created as a result of processing the block of subdirectives of the target directive.

The source directives in the block specify input files, and all sources in the directive block are used to create the target file. The mapping of source types to target types determines what processes are run. Options that are in effect when the target directive is processed are applied to the target file.

This diagram shows the syntax of the target directive:

The target directive has the following parameters:

target_file
This parameter must be a string data element. It specifies the name of the target file. It can include an absolute or relative path. If the target string is empty, the directive block is processed but the target directive has no other effect.

type(string)
The optional type clause determines what kind of target is built. Use this clause to override the file extension of the target file name.

directive_block
This parameter specifies subdirectives of the target directive. The directives in this block define source files and their options.

If you do not include a type clause, the file extension of the target file name determines what type of target is built. If you include a type clause, the string specified in the type clause determines the type of the target. In either case, the output file is given the extension you supply with the target file name. A file extension is not appended if you omit it from the file name. If you omit the type clause and give no extension or an unknown extension with the file name, an executable file is produced.

Only one target directive is allowed for each target file in the configuration. If a target directive names a file that is already a target, VisualAge C++ outputs a warning and ignores all but the first target directive for the file.

You can create only one target file of type .exe from a single codestore.

Target directives can be nested, but there is no semantic relationship between them. The directive block for each target is associated with the closest enclosing target directive.



Configuration Files
How Configuration Files Are Processed


Change a Build Setup
Add or Change Targets
Produce Multiple Targets from One Build
Build


Types of Target Files
Configuration File Directives
Build Options