Runtime operationsWhen Waf starts, the following operations are performed: - finding the wafadmin directory (waf python files), and creating it if missing
- reading the options: waf imports the project scripts named "wscript" as python modules and looks for custom commmand-line options (call the set_options functions)
- configuring the project: if configure was requested, waf will perform the various configuration tests (call the configure functions) and write the output into python files in the build dir
- building the project
- call the build options of the scripts, the build options create task generators
- call the task generators to create individual tasks
- call the scheduler to execute the tasks
- installing the files: if install was requested, the files wil be installed
Main concepts- The model (file system representation, command-line) is separated from the view (classes, apis, declaration of libraries), the user scripts create objects, which delays the creation of tasks that are processed by a scheduler
- The source folders must not be polluted with files created during the build. The source directory is more readable, and errors caused by files remaining are limited (headers in the build directory)
- Different versions of the same object files are possible, this is used for building different versions of the same programs or libraries for debugging or for different architectures
- Compilation flags and additional parameters can be given by adding attributes, using a css-like syntax
- The configuration is performed in a step separate from the build, and the settings are stored in a cache
- Custom command-line options can be defined
- Tasks may be run one by one or in parallel (like make -j)
- Waf fits in a single redistributable script compatible to python 2.3
|