Introduction
This manual is the reference for the GNAT Project (GPR) system: the project file language and the tools that use it.
What is GPR?
A GPR project file (.gpr) describes a software component: where its
sources live, how they should be compiled, what libraries or executables
are produced, and how it relates to other components. The project file
language is declarative - it specifies what to build, not how - and the
GPR tools translate those declarations into concrete build, install, inspect,
or clean operations.
GPR is multi-language: a single project tree may combine Ada, C, C++, and other languages. The active configuration project (generated by GPRconfig from the Knowledge base (KB)) supplies the toolchain-specific details - compiler drivers, default switches, library conventions - for each language.
Tools covered
This manual covers the following tools:
- GPRbuild (GPRbuild Reference)
Multi-language build tool. Compiles sources, binds Ada programs, builds libraries, and links executables using a DAG-based incremental build engine.
- GPRclean (GPRclean Reference)
Removes build results produced by GPRbuild.
- GPRinstall (GPRinstall Reference)
Installs build results into a prefix directory and maintains manifests for later uninstallation.
- GPRls (GPRls Reference)
Lists the sources, units, objects, and dependencies of a project tree, with up-to-date status.
- GPRname (GPRname Reference)
Scans source directories and generates a project file with a
Namingpackage for non-standard file naming conventions.- GPRconfig (GPRconfig Reference)
Probes the host for available compilers and generates a configuration project (
.cgpr) describing the selected toolchains.- GPRinspect (GPRinspect Reference)
Displays the resolved structure and attributes of a loaded project tree, in human-readable or JSON format.
Document structure
This manual is divided into two parts:
- GPR Project Language
Covers the project file language itself: project kinds and qualifiers, project extension, the project file syntax, source resolution rules, and the attribute reference.
- GPR Tools
Covers the knowledge base and each tool’s command-line interface, project packages, and behavior.
Two appendices complete the manual: an Environment Variables reference and a Glossary.
LibGPR2
The GPR tools described in this manual are built on top of LibGPR2, an Ada library that implements the GPR project model - parsing project files, resolving sources and dependencies, and exposing the result as a queryable object model. It also provides a build infrastructure that can be used to implement custom incremental builders. Developers who need to integrate GPR project loading or build orchestration into their own tools work directly with LibGPR2.