adep(1) CLIX adep(1)
NAME
adep - Generates Ada program makefiles
SYNOPSIS
adep [-f makefile] [-M main_unit] [-o objfile] [-t target] [-c compiler]
[-F] [-V] file ... [-I file ... ]
FLAGS
-f makefile Names the output file, makefile. If the name of the
makefile is not supplied, the name makefile is assumed.
-M main_unit Causes adep to treat main_unit as the name of the main
program unit. The name main is used by default.
-o objfile Specifies the name of the executable file to be produced.
The default name of the executable file is a.out.
-t target Indicates that no executable file will be produced and
specifies the name of the main target.
-c compiler Specifies the Ada compiler to be used. The default
compiler is Ac.
-I file ... Indicates that all following Ada source files should be
included as possible prerequisites but not as targets in
the makefile. This flag could be used to construct
dependencies between directories or program libraries.
(This flag may follow the list of files.)
-F Forces adep to generate a makefile. This flag overwrites
existing makefiles of the same name.
-V Displays various statistics such as the number of targets
and dependencies about the makefile.
Extra flags to the Ada compiler may be set as follows :
adep "AFLAGS=-O -v" *.[HA]
This passes the optimizer flag and verbose flag to all calls of the Ada
compiler. In a similar way, the user may pass any variable and value to
adep (such as CFLAGS) and these will be included in the makefile. (See
make(1).)
DESCRIPTION
The adep command takes a set of Ada source files and constructs a file
usable by the make command containing all the dependencies necessary to
2/94 - Intergraph Corporation 1
adep(1) CLIX adep(1)
produce an executable a.out file. The user may request a rule for an
executable file to be produced using -o or a rule to maintain only the
object files using -t. A rule for cleaning up the directory is also
available (invoked with the make clean command.) In addition, a rule for
making a new makefile is generated and is invoked with the make make
command. This rule can be used to update the makefile whenever the
dependencies between the units change.
File suffixes are interpreted as follows:
.H or .A An Ada source file which is scanned to determine the list of
dependencies.
.c A C source file which is compiled and loaded with other object
files to produce any required executable module.
.s An assembly language source file which is assembled and loaded
with other object files to produce any required executable
module.
.o An object file which is loaded with other object files to
produce any required executable module. Note that object files
produced from Ada source files are loaded automatically and
must not be included here.
.a An archive file containing object files which is loaded with
other object files to produce any required executable module.
Alternatively, the user may specify archive files using the -l
flag (see cc(1) and ld(1)).
All other files are ignored.
If the name of a directory is given instead of a list of files, adep
searches the directory for all files with the suffixes .H, .A, .c, and .s.
Note that files suffixed with .o and .a are ignored in this case.
The adep command marks the start of the generated dependencies in the
makefile with the following line:
# Ada dependencies generated by adep
The adep command marks the end of generated dependencies in the makefile
with the following line:
# End of Ada dependencies
Everything outside of these lines remains untouched by adep, so any
additions to the makefile by the user will not be affected by later use of
adep with this file.
The dependency set is replaced each time adep is used; dependencies cannot
2 Intergraph Corporation - 2/94
adep(1) CLIX adep(1)
be added or removed incrementally.
The adep command is not an Ada language parser. It looks for with
clauses, separate clauses, and the unit or subunit information. It then
attempts to reach the end of the current unit before repeating the process
for any following units in the file. It does so by relying on the
positioning of semicolons and certain reserved words (such as end, loop,
and begin.) Consequently, a serious syntax error will cause adep to
terminate with an error message and a line number. In this case running
the Ada compiler may help to obtain more information about the error.
EXAMPLES
This example creates a makefile that will generate the executable file
maze. The -E5 flag will be passed to the Ada compiler. All files in the
current directory ending with a .A, .H, or .c suffix will be considered
source files for the executable file.
adep -o maze "AFLAGS = -E5" *.A *.H *.c
CAUTIONS
For an instantiation of an external generic, adep records a dependency on
the generic body and all subunits of the generic. The adep command
becomes confused if different generics have the same name or a generic has
the same name as the unit in which it occurs. However, it usually
displays a message in this case.
EXIT VALUES
The adep command exits with a value of 0 if successful. If unsuccessful,
it exits with a value of 1.
RELATED INFORMATION
Commands: Ac(1), acc(1), cc(1), make(1)
2/94 - Intergraph Corporation 3