The Waf Book (v1.5.7)

Thomas Nagy

Copies of this book may be redistributed, verbatim, and for non-commercial purposes. The license for this book is by-nc-nd license


Table of Contents

Preface
About build systems in general
The Waf approach
Objectives of this book
1. Getting Started
Obtaining Waf
Installing
Running Waf
2. Introduction to the Waf scripting system
Empty project example
Workflow illustration on a more complicated example
Building a project - Introduction to Tasks
Configuring a project
Adding custom command-line options
Installing targets
3. The configuration system
Overview of the configuration files
The configuration environments
Configuration helper execution
Adding new configuration helpers
4. Packaging and redistributing the source code
Quick tarball creation
Custom archives
Cleaning the project tree
5. The Task system
Task creation and execution
Task execution
Task execution in parallel
Task execution order
Executing tasks only when something changes
6. Task encapsulation using task generators
Explicit rules for simple transformations (Make-like)
Implicit processing based on file name or extension
Custom processing by task generator methods
Task generator method execution
7. The scheduler for executing the tasks
The task execution model
Job control
Weak task order constraints
8. C and C++ projects
Common script for C/C++ applications
Library interaction (uselib)
Customizing object files
Using configuration headers
The include system
Configuration helpers
Pkg-config
9. Advanced scenarios
Simple file transformations
Same targets, different configurations (variants)
Building the compiler first
Writing the output of a program into a header
A compiler producing source files with names unknown in advance
A task without any file dependency
10. Customizing the scripting system
Providing custom commands
Chaining commands
Providing a custom command context
Creating aliases / Injecting new commands
11. Using the development version
Tracing the execution
Benchmarking
Profiling
Tracing parallel task execution
Obtaining the latest source code
Programming constraints
12. Overview of the Waf architecture
The core library
Build context instances
Overview of the Waf execution
Performance and build accuracy
13. Conclusion
Glossary

List of Tables

11.1. Debugging zones
12.1. The core library
12.2. Build context persistence
12.3. Build context access
13.1. Recommended links