PowerAda asrcdep

From OC Systems Wiki!
Jump to: navigation, search


asrcdep - analyze source dependencies


asrcdep [-h] [-v] [-c] [-m] [-F | [-g] [-i]] 
        [-u UnitName] {-I | FileName ...}


This command determines, from a given list of Ada source files, a reasonable compilation order for those files. The source is analyzed to determine the dependencies created by context clauses.


Requests help for the command. If it is specified, all other options and parameters (except erroneous ones) are ignored.
Causes asrcdep to display progress messages. For instance, a message every ten files indicates how many files in total have been processed.
Causes asrcdep not to report missing files.
Causes asrcdep to ignore dependencies from non-generic units containing generic units. It does not affect dependencies caused by generic units.
Causes asrcdep to ignore dependencies caused by pragma INLINE.
Causes asrcdep to do a "fast" analysis, which has the following differences from its regular analysis:
  • Only the first unit in any file is processed.
  • If there is more than one unit in a file, this fact is not detected and asrcdep processes only the first one. This means, for example, that units can be reported as missing even if they do exist in one of the files.
  • Pragma INLINE will not be detected, so the -i option is considered to be in effect even though you cannot explicitly provide it.
  • Generic units inside non-generic units will not be detected, so the -g option is considered to be in effect even though you cannot explicitly provide it.
  • Some syntax errors are not detected, since only part of the first unit is analyzed.
-u UnitName
Indicates that dependency information need only be generated for the given unit. The unit name may start with lib/ or sec/; if it does not, dependency information is generated for both the specification and body of the given unit if both are present in the source files.
Causes asrcdep to continue despite the following errors:
  • Syntax errors in source
  • Non-existent files
  • Other errors.
Each error is reported to standard error. The final return does not reflect any of the errors, and asrcdep processes as much of each file as it can. The resulting compilation list can be incomplete or errors (such as missing unit) can be reported as a result of other errors (such as syntax errors).
Specifies that a list of files names will be read from standard input.
If "--" is found in a line read from standard input, the rest of the line is ignored.


FileName . . .
Specifies one or more Ada source files to analyze. Specify "-" as one of the file names to read Ada source from standard input.


  1. The order takes into account the need to have generic bodies compiled before the associated generic is instantiated.

  2. Some kinds of dependencies are difficult to determine through source analysis alone. "Unit Dependencies Created by Inlining" in Chapter 9 gives more information about dependencies introduced by inline expansion.

    The asrcdep command may generate some dependencies that do not really occur. If a package includes a context clause naming another package that declares generic units or subprograms with pragma INLINE applied, but does not instantiate the generics or call the subprograms, asrcdep may report that there are circular dependencies, even when a correct compilation order exists. If you know that a correct compilation order exists, use the options -i and/or -g to make asrcdep ignore the unnecessary body dependencies.

  3. No dependencies are generated for units defined by the language standard, for example TEXT_IO or CALENDAR. The asrcdep command does not report any error when the source for these units is not present in the specified source files.


Below is a list of the possible values returned by asrcdep. Refer to Return Codes for Commands for details about the meaning of these return s.

0, 1, 2, 4, 7, 8, 9, 13, 99



the asrcdep program image


This must be defined and indicate the powerada/ada95 directory in the PowerAda installation.




See Problems and Questions at the beginning of this Appendix.