3.3.5 The build cycle
Building an application or DLL from a project consists of up to three phases:
- 1. Building the subprojects.
- 2. Compiling some or all of the project source code.
- 3. Linking the project.
For efficiency, when the compiler is asked to build a project it minimizes the number of these phases that it performs, using the following decision rules:
- If phase 2 or 3 is performed, the project is considered changed.
- A clean build always performs all phases for the project and its subprojects.
- You can ask for a clean build by choosing Project > Clean Build in any window that has a Project menu.
- A build command is always recursively performed on subprojects (phase 1).
- If the major version number of any subproject has been changed, then all of the source code in the project is recompiled.
- If the project is tightly bound to any subproject which has changed, then all the source code in the project is recompiled.
- If the project is tightly bound to itself, and if any source code in the project has changed, then all the source code in the project is recompiled.
- If the project is loosely bound to itself, then any source code files that have changed are recompiled. Additionally, files that depend on those changes (such as through macro usage) are recompiled.
- If the project or any of its subprojects has changed, then the project is relinked.
Note: To ensure change propagation according to these rules, you should always increment the major version number of a project after altering any macro definitions in it.