![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
More About Basic Build Management ConceptsNote: Build Management functionality is available in Apex C/C++ and Apex Duo.
This section presents a brief overview of how the standard C/C++ build management facilities are used to support compilation and other activities. More extensive information about build management can be found in the C++ Compiler Reference.
All build activities occur in views.The specific characteristics of build activities in a view are determined by the view's build key which is specified by a switch of the same name in the view's switch file. The build key is usually derived from the model which was provided when the view was created. The standard models for C/C++ build management are based on standard build keys which contain the following:
- Prototype makefiles which will be propagated into views and their subdirectories.
- Scripts which will be invoked from the makefiles.
- Property files which define the build environment, including:
- A description of makefile characteristics.
- The names of macros in the makefiles whose values will be automatically updated by Apex.
- Tables which define how Apex commands are to be translated into make commands.
Views utilizing the standard C/C++ build keys and models are created by the create_working and create_release commands and copied by the copy_view command. Generally C/C++ views are created using the default C/C++ model which is available in the session switch APEX_CPP_MODEL. When a view is created with a standard C/C++ model all makefiles and directory structures required by the build system are created.
C/C++ source files are usually created by either the create_c or create_cpp commands. These commands create C/C++ header and source files with initial contents that are based on special prototype files. C/C++ files may also be copied into views by Apex commands or by Unix shell commands. Regardless of how files are created, makefiles and related directory structures are updated appropriately by Apex prior to running any build commands.
C/C++ source files are compiled by running the code command. The integration between Apex Build Management and the Apex C/C++ compilers automatically manages the dependency information that is used by make to detect obsolescence of object files.
C/C++ source files may directly include any header file within the same view. Header files in other views may only be included if architectural relationships have been established. Namely the view containing the header file must export the header file and the view containing the include must import the view which exports the header file. Within include directives which satisfy architectural relationships, header files may be named either by their simple name (#include "file.h") or by their subsystem-relative name ( #include "subsystem/file.h").
Entire views may be compiled by running the code command on the view itself. Compiling a view causes all source files in the view to be compiled and in addition creates any required libraries. The creation of libraries is controlled by the build policy associated with the view. Different build policies are defined by the standard build keys to allow libraries to be built with different contents or allow externally constructed libraries to be managed. By default, when libraries are constructed all object files are checked and regenerated if they are obsolete including the object files associated with template instantiation.
Prior to linking a main program, the source file containing the main entry point must be registered by running the register_main_program command. Actual linking occurs when the link command is run on the registered main program file. The closure of a main program is the set of object files, libraries and option settings which must be passed to the linker in order to link the main program. The closure of a C/C++ main program is computed by first identifying appropriate views and then querying views to determine the contribution which each view will make to the overall closure. Support is also provided for linking C/C++ code in the closure of Ada main programs.
All Summit/CM operations may be applied to C/C++ files. C/C++ files may be placed under version control. When C/C++ files are created, deleted, or copied between views by Summit/CM operations, all appropriate makefiles and directories are automatically updated.
A number of mechanisms are provided for customization of the standard build operations. The customization operations allow standard operations to be augmented or completely redefined.
Additional Topics
Rational Software Corporation http://www.rational.com support@rational.com techpubs@rational.com Copyright © 1993-2001, Rational Software Corporation. All rights reserved. |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |