PowerAda aprojbuild

From OC Systems Wiki!
Jump to: navigation, search


aprojbuild - compile, recompile Ada programs within a project.


aprojbuild [-aeghnvzFGIOUX] [-b|c|l|p|u|x] [-E error_file ]
           [-L sublibrary ] [-P project ] [ names ... ] [--]


aprojbuild is the all-purpose compilation and linking tool to use from the command line within a PowerAda project. It is also invoked by the Powerada Build Windows.

aprojbuild will also work in the absence of a project by treating the current directory as a "pseudo project" and all other sublibraries as external to the project. In this way, aprojbuild may be used in place of abuild in an environment where projects are not appropriate.


Prints version, and command line help information.
Remainder of line are compile or bind options passed to the ada command. E.g., aprojbuild -v t.ada -- -OS
names are source file names to simply compile without analysis
-D count
retry pre_bind step count times
-E error_file
read/write names of files that failed to compile from/to error_file. This is used to prevent repeated attempts to compile files that are known to fail from one invocation to the next. It is recommended that error_file be a temporary name used only within a single script invocation, since picking up a file left from a previous run could prevent corrected files from being recompiled.
Continue if errors occur. This conflicts with -e.
Is being invoked by powerada GUI (for internal use only);
Read names from standard input (see -i)
-L sublibrary
Use root sublibrary sublibrary if not determined from other arguments; default is pwd/adalib
same as -n, but do loads without confirmation.
Inherit (don't override) existing compile/bind options; that is, apply options following -- only to previously uncompiled files.
-P project
Use project as existing project to compile into. Project is normally determined from the specified sublibrary, the sublibrary implied by the argument to -x, or the current directory.
Update each sublibrary operated upon (if used with -L, -c, -l, or -u) or else update pwd/adalib.
Fails immediately rather than waiting if a per-sublibrary write-lock is cannot be gotten (see -w option)
Link with sublibraries, not previous executable file (allowed only with or instead of -x)
Operate on all specified files/units, not just new/changed ones; with -b, -x, -m, forces a bind even if no apparent changes.
Single name is a main unit name for binding. Use -L to specify the library in which name appears if other than pwd/adalib.
namesare source file names to load, compile
Don't bind, (-m, -x, -b) just make the main unit linkable
Invoke text editor defined on source files containing errors. The editor program is defined by the EDITOR environment variable. If EDITOR is not defined, uses /bin/vi.
Single name is a file of BUILD COMMANDS.
When used with -U, update whole library defined by the specified root sublibrary, not just sublibrary.
-i file
Read names from file (see -I)
By itself, indicates that the specified names are to be loaded; with -Ubmpux, load the changed files associated with the specified arguments before update.
With [l,]c,C: bind using last unit in last filename
Echo commands to stdout, but don't execute them. This may prompt for confirmation if changed files need to be loaded before doing a complete analysis.
-o exe_file
File to which to write resulting executable file (with -b, -m,

-x). This is equivalent to "-- -o exe_file"

Update all sublibraries in current project.
load registered files for named or default sublib.
skip compiling loaded independent bodies (those needed only for binding).
Update are compilation units specified by names in

pwd/adalib or the library indicated by -L

Verbose: write progress messages to stderr.
Fail, don't wait, for project-wide write-lock
Single nameis a PowerAda executable to be updated. The library and list of units are determined from the named file. If -l is also specified, changed files are loaded before computing the update actions.
Return 10 rather than 0 if no operations and no errors


Arguments interpreted according to above flags.


The -f flag to aprojbuild indicates that it consumes one-line commands of a special format. This format is the same that is shown when aprojbuild executes:

action { file | unit } sublibrary  [ options ]

The possible actions are:

load file into sublibrary with the designated compile options
compile file into sublibrary with the designated options
compile the pending unit into sublibrary
recompile a previously compiled unit into sublibrary
bind a main unit from the named root sublibrary with the designated bind options.
re-check the dependencies of all units and instantiate any instance subunits which were created in the first pass.
For example
LOAD tb.ada  adalib -v
COMP t(body) adalib -v
BIND t(body) adalib -o t


 0 - compiles/binds completed successfully
 1 - invalid abuild parameters
     command line too long, or
     invalid license
 2 - file not found
 3 - library cannot be opened
 4 - missing main unit
 7 - circular dependency
10 - no operations were performed and return code would
     otherwise be 0
13 - syntax or semantic error in compilation
27 - missing or obsolete compilation units
99 - unknown error


$POWERADA/bin/aprojbuild  - the aprojbuild program image.
$POWERADA/tools/bin/Adaentry - the compiler implementation
$POWERADA/bin/ada - the compiler driver


This must be defined and indicate the powerada/ada95 directory in the PowerAda installation.
Names a baselines file identifying aliases for baseline projects.
Defines which editor is used when -e is specified.


# compile t.ada and any obsolete supporters:
aprojbuild t.ada
# compile t.ada and any obsolete supporters:
aprojbuild t.ada
# update the units in the sublibrary in current directory
aprojbuild -U
# load and changed files in the current sublibrary, 
# then update it:
aprojbuild -lU
# just load all the changed files or new files in the
# current directory's sublibrary so thaty they are compiled
# with optimization, but don't compile them:
aprojbuild -rU -- -O
# load changed and update for the entire library (sublibrary
# plus imports) rooted at ./work/adalib:
aprojbuild -L ./work/adalib -lUg
# load, compile and bind a program called main, assuming
# adalib.files, adalib.imports are correctly defined:
aprojbuild -L /u/fred/adaproj/driver/adalib -vlb main
# recompile any changed or obsolete files needed by program
# t.exe, and relink t.exe with these changes, if any
aprojbuild -evlx t.exe


aprojinit, powerada.


See Problems and Questions at the beginning of this Appendix.