GPRls Reference
GPRls lists the sources, units, objects, and dependencies of a GPR project tree. It reads the build database produced by GPRbuild to report the up-to-date status of each artifact.
Command Line
Syntax
gprls [-P<proj>.gpr] [switches] [files]
Project file and common switches
See Common Command-Line Options for project file discovery rules, project and configuration switches, and common diagnostic switches.
Files
Zero or more source file names may be given on the command line to restrict
output to those files only. Simple names (without directory) are matched
against source basenames; full paths are also accepted. If no files are
given, GPRls lists all sources of the project (or of the entire project tree
with -U).
Switches
Output selection
When none of -u, -s, or -o is given, GPRls prints all three
categories for each compilation unit.
-uPrint the unit name for each Ada compilation unit.
-sPrint the source file for each compilation unit.
-oPrint the object file for each compilation unit.
-dFor each source file, also list the source files it depends on, together with their status. Superseded by
--closure.--closureCompute the transitive compilation closure of the named files (or of the project’s main units if no files are given) and list every source file required to compile them.
-UList sources from the entire project tree, not only the root project.
-aInclude predefined (runtime) units in the output and in dependency lists.
-a0Same as
-a, but print only the simple file name for runtime sources, hiding the runtime directory path.--hide-statusSuppress the
OK/DIFstatus indicator from the output.--source-parserDerive dependency information by parsing Ada source files directly rather than reading ALI files. Useful when ALI files are absent or stale.
-files=fileRead the list of source files to process from file (one name per line, blank lines ignored). The resulting list is merged with any files given on the command line.
Status indicators
Unless --hide-status is given, each artifact is prefixed with a status
tag:
OKThe artifact is up to date: its timestamp matches the build database.
DIFThe artifact has been modified since the last build.
Output layout
Entries are grouped by compilation action. Within each group, the default indentation is:
Objects - no indentation.
Unit names and sources - indented by 3 spaces.
Dependencies (with
-d) - indented by 3 spaces.
Example output (all three categories, with status):
OK obj/pack.o
pack
OK src/pack.ads
OK src/pack.adb
Exit Codes
0Success.
1General error (invalid option, project error, etc.).