Download GPRbuild User's Guide

Transcript
Chapter 1: GNAT Project Manager
1 GNAT Project Manager
1.1 Introduction
This chapter describes GNAT’s Project Manager, a facility that allows you to
manage complex builds involving a number of source files, directories, and
options for different system configurations. In particular, project files allow you
to specify:
• The directory or set of directories containing the source files, and/or the
names of the specific source files themselves
• The directory in which the compiler’s output (‘ALI’ files, object files, tree
files, etc.) is to be placed
• The directory in which the executable programs are to be placed
• Switch settings for any of the project-enabled tools; you can apply these
settings either globally or to individual compilation units.
• The source files containing the main subprogram(s) to be built
• The source programming language(s)
• Source file naming conventions; you can specify these either globally or for
individual compilation units (see Section 1.2.8 [Naming Schemes], page 13).
• Change any of the above settings depending on external values, thus enabling the reuse of the projects in various scenarios (see Section 1.4 [Scenarios in Projects], page 21).
• Automatically build libraries as part of the build process (see Section 1.5
[Library Projects], page 23).
Project files are written in a syntax close to that of Ada, using familiar notions
such as packages, context clauses, declarations, default values, assignments,
and inheritance (see Section 1.7 [Project File Reference], page 34).
Project files can be built hierarchically from other project files, simplifying complex system integration and project reuse (see Section 1.3 [Organizing
Projects into Subsystems], page 16).
• One project can import other projects containing needed source files. More
generally, the Project Manager lets you structure large development efforts into hierarchical subsystems, where build decisions are delegated to
the subsystem level, and thus different compilation environments (switch
settings) used for different subsystems.
• You can organize GNAT projects in a hierarchy: a child project can extend a
parent project, inheriting the parent’s source files and optionally overriding
any of them with alternative versions (see Section 1.6 [Project Extension],
page 30).
1