Next: Regular Expressions in gnatfind and gnatxref, Previous: gnatfind Switches, Up: The Cross-Referencing Tools gnatxref and gnatfind [Contents][Index]
Project files allow a programmer to specify how to compile its application, where to find sources, etc. These files are used primarily by GPS, but they can also be used by the two tools gnatxref and gnatfind.
A project file name must end with .gpr
. If a single one is
present in the current directory, then gnatxref and gnatfind will
extract the information from it. If multiple project files are found, none of
them is read, and you have to use the -p
switch to specify the one
you want to use.
The following lines can be included, even though most of them have default
values which can be used in most cases.
The lines can be entered in any order in the file.
Except for src_dir
and obj_dir
, you can only have one instance of
each line. If you have multiple instances, only the last one is taken into
account.
[default: "./"]. Specifies a directory where to look for source files. Multiple src_dir lines can be specified and they will be searched in the order they are specified.
[default: "./"]. Specifies a directory where to look for object and library files. Multiple obj_dir lines can be specified, and they will be searched in the order they are specified
[default: ""]. Creates a variable which can be referred to subsequently by using the ${comp_opt} notation. This is intended to store the default switches given to `gnatmake' and `gcc'.
[default: ""].
Creates a variable which can be referred to subsequently by using
the $`bind_opt'
notation. This is intended to store the default
switches given to `gnatbind'.
[default: ""].
Creates a variable which can be referred to subsequently by using
the $`link_opt'
notation. This is intended to store the default
switches given to `gnatlink'.
[default: ""].
Specifies the name of the executable for the application. This variable can
be referred to in the following lines by using the `${main'
notation.
[default: "gcc -c -I${src_dir} -g -gnatq"]. Specifies the command used to compile a single file in the application.
[default: "gnatmake ${main} -aI${src_dir} -aO${obj_dir} -g -gnatq -cargs ${comp_opt} -bargs ${bind_opt} -largs ${link_opt}"]. Specifies the command used to recompile the whole application.
[default: "${main}"]. Specifies the command used to run the application.
[default: "gdb ${main}"]. Specifies the command used to debug the application
`gnatxref' and `gnatfind' only take into account the src_dir and obj_dir lines, and ignore the others.