PowerAda aprojbuild

From OC Systems Wiki!
< PowerAda:APPENDIX E. Tools Reference
Revision as of 00:35, 25 April 2019 by imported>WikiVisor (Text replacement - """ to """)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


NAME

aprojbuild - compile, recompile Ada programs within a project.

SYNOPSIS

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

DESCRIPTION

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.

OPTIONS

-h
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
-C
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.
-F
Continue if errors occur. This conflicts with -e.
-G
Is being invoked by powerada GUI (for internal use only);
-I
Read names from standard input (see -i)
-L sublibrary
Use root sublibrary sublibrary if not determined from other arguments; default is pwd/adalib
-N
same as -n, but do loads without confirmation.
-O
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.
-U
Update each sublibrary operated upon (if used with -L, -c, -l, or -u) or else update pwd/adalib.
-W
Fails immediately rather than waiting if a per-sublibrary write-lock is cannot be gotten (see -w option)
-X
Link with sublibraries, not previous executable file (allowed only with or instead of -x)
-a
Operate on all specified files/units, not just new/changed ones; with -b, -x, -m, forces a bind even if no apparent changes.
-b
Single name is a main unit name for binding. Use -L to specify the library in which name appears if other than pwd/adalib.
-c
namesare source file names to load, compile
-d
Don't bind, (-m, -x, -b) just make the main unit linkable
-e
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.
-f
Single name is a file of BUILD COMMANDS.
-g
When used with -U, update whole library defined by the specified root sublibrary, not just sublibrary.
-i file
Read names from file (see -I)
-l
By itself, indicates that the specified names are to be loaded; with -Ubmpux, load the changed files associated with the specified arguments before update.
-m
With [l,]c,C: bind using last unit in last filename
-n
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"

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

pwd/adalib or the library indicated by -L

-v
Verbose: write progress messages to stderr.
-w
Fail, don't wait, for project-wide write-lock
-x
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.
-z
Return 10 rather than 0 if no operations and no errors

PARAMETERS

names
Arguments interpreted according to above flags.

BUILD COMMANDS

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
load file into sublibrary with the designated compile options
COMPILE
compile file into sublibrary with the designated options
COMP
compile the pending unit into sublibrary
RECOMP
recompile a previously compiled unit into sublibrary
BIND
bind a main unit from the named root sublibrary with the designated bind options.
UPDATE
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

RETURN CODES

 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

FILES

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

ENVIRONMENT VARIABLES

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

EXAMPLES

# 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

SEE ALSO

aprojinit, powerada.

BUGS/LIMITATIONS

See Problems and Questions at the beginning of this Appendix.