Installing and Building Your SourcePro® C++ Products : Chapter 3 Buildspec Details : Working with Buildspecs
Working with Buildspecs
This section defines buildspecs and provides details regarding basic functionality in the RCB environment. Elements described include avoiding common mistakes, how to modify a buildspec without changing its name, and how to modify a buildspec in an export buildspace.
What is a Buildspec?
A buildspec is a file that provides information to the build manager on how to conduct a build. The information contained in the buildspec includes:
target buildspace
components to be built
platform
general build options
module-specific build options, if applicable
user-specified build options
Common Buildspec Mistakes
This section explains how to avoid common mistakes and related problems.
Changing Answers and Accidentally Creating a New Buildspec
The buildspec_name value is used as a directory name to store build results. Some build option answers are used to generate the root of buildspec_name. Changing those answers will force a new buildspec name and thus create a distinct configuration when built.
“Select Naming Convention” provides information on answers that affect the buildtag used in the buildspec_name and explains your options.
The advantage of deriving buildspec_name from answers is that it decreases turnaround time if you need to obtain technical support.
Accidentally Overwriting a Buildspec
If you edit an existing buildspec, the modified buildspec may overwrite the original. If this is not what you intend, you can prevent this by forcing a new name for the buildspec. This can be done by specifying a new user-defined tag or modifying the answer to one of the following build options: threading, debugging, or linking. This will result in a distinct configuration being built.
The same danger applies if you edit a buildspec from another buildspace and your buildspace already contains a buildspec for the same build configuration.
Modifying a Buildspec Without Changing Its Name
As “Common Buildspec Mistakes” warns, when you modify a buildspec there is a chance that you might change the buildspec name since the name is derived from the options selected. The new configuration creates a new directory and the whole build process begins anew.
If you modify an existing buildspec that has already been built and the name does not change, you may have problems. This occurs because the actions RCB performs depend on the state of that configuration in the buildspace. In other words, what RCB does varies depending on which build artifacts, such as makefiles and object files, exist.
NOTE >> Rogue Wave strongly recommends that you ensure that the build starts in an empty directory any time you modify a buildspec.
There are two ways to ensure that the build starts in an empty directory: modify the user-defined tag (as explained in “Select Naming Convention”) or select the prebuild clean option (as explained in “Select Clean Options”). Either way, all artifacts are removed, which allows RCB to perform all steps of the build process from scratch. If you do not do this, RCB will not recreate a makefile if it already exists; it will start a compile from where it left off.