Next: Switches, Up: Building with GPRbuild [Contents][Index]
Three elements can optionally be specified on GPRbuild’s command line:
The general syntax is thus:
gprbuild [<proj>.gpr] [switches] [names] {[-cargs opts] [-cargs:lang opts] [-largs opts] [-gargs opts]}
GPRbuild requires a project file, which may be specified on the command line either directly or through the -P switch. If not specified, GPRbuild uses the project file default.gpr if there is one in the current working directory. Otherwise, if there is only one project file in the current working directory, GPRbuild uses this project file.
Main source files represent the sources to be used as the main
programs. If they are not specified on the command line, GPRbuild uses
the source files specified with the Main
attribute in the project
file. If none exists, then no executable will be built.
It is also possible to specify absolute file names, or file names relative
to the current directory. Finally, it is possible to specify Ada unit names
(and gprbuild automatically looks up the corresponding file name in the
project).
When source files are specified along with the option -c, then recompilation will be considered only for those source files. In all other cases, GPRbuild compiles or recompiles all sources in the project tree that are not up to date, and builds or rebuilds libraries that are not up to date.
If invoked without the --config= or --autoconf= options, then GPRbuild will look for a configuration project file default.cgpr, or <targetname>.cgpr if option --target=<targetname> is used. If there is no such file in the default locations expected by GPRbuild (<install>/share/gpr and the current directory) then GPRbuild will invoke GPRconfig with the languages from the project files, and create a configuration project file auto.cgpr in the object directory of the main project. The project auto.cgpr will be rebuilt at each GPRbuild invocation unless you use the switch --autoconf=path/auto.cgpr, which will use the configuration project file if it exists and create it otherwise.
Options given on the GPRbuild command line may be passed along to individual tools by preceding them with one of the “command line separators” shown below. Options following the separator, up to the next separator (or end of the command line), are passed along. The different command line separators are:
The arguments that follow up to the next command line separator are options for all compilers for all languages. Example: -cargs -g
The arguments that follow up to the next command line separator are options for the compiler of the specific language.
Examples:
The arguments that follow up to the next command line separator are options for all binder drivers.
The arguments that follow up to the next command line separators are options for the binder driver of the specific language.
Examples:
The arguments that follow up to the next command line separator are options for the linker.
The arguments that follow up to the next command line separator are options for GPRbuild itself. Usually -gargs is specified after one or several other command line separators.
Equivalent to -gargs, provided for compatibility with
gnatmake
.