4.2. Switches for gnatmake

You may specify any of the following switches to gnatmake:

-a

Consider all files in the make process, even the XGC Ada internal system files (for example, the predefined Ada library files), and also any locked files. Locked files are filed whose ALI file is write protected. By default, gnatmake does not check these files, because the assumption is that the XGC Ada internal files are properly up to date, and also that any write protected ALI files have been properly installed. Note that if there is an installation problem, such that one of these files is not up to date, it will be properly caught by the binder. You may have to specify this switch if you are working on XGC Ada itself. -f is also useful in conjunction with -a if you need to recompile an entire application, including run-time files, using special configuration pragma settings, such as a non-standard Float_Representation pragma. By default gnatmake -a compiles all XGC Ada internal files with gcc -c -gnatg rather than gcc -c.

-c

Compile only. Do not perform binding and linking. If the root unit specified by unit_or_file_name is not a main unit, this is the default. Otherwise gnatmake will attempt binding and linking unless all objects are up to date and the executable is more recent than the objects.

-f

Force recompilations. Recompile all sources, even though some object files may be up to date, but don't recompile predefined or XGC Ada internal files or locked files (files with a write protected ALI file), unless the -a switch is also specified.

-jn

Use n processes to carry out the (re)compilations. If you have a multiprocessor machine, compilations will occur in parallel. In the event of compilation errors, messages from various compilations might get interspersed (but gnatmake will give you the full ordered list of failing compiles at the end). If this is problematic, rerun the make process with n set to 1 to get a clean list of messages.

-k

Keep going. Continue as much as possible after a compilation error. To ease the programmer's task in case of compilation errors, the list of sources for which the compile fails is given when gnatmake terminates.

-M

Check if all objects are up to date. If they are output the object dependences to stdout in a form that can be directly exploited in a Makefile. By default, each source file is prefixed with its (relative or absolute) directory name. This name is whatever you specified in the various -aI and -I switches. If you use gnatmake -M -q (see -q below), only the source file names, without relative paths, are output. If you just specify the -M switch, dependencies of the XGC Ada internal system files are omitted. This is typically what you want. If you also specify the -a switch, dependencies of the XGC Ada internal files are also listed. Note that dependencies of the objects in external Ada libraries (see switch -aLdir in the following list) are never reported.

-i

In normal mode, gnatmake compiles all object files and ALI files into the current directory. If the -i switch is used, then instead object files and ALI files that already exist are overwritten in place. This means that once a large project is organized into separate directories in the desired manner, then gnatmake will automatically maintain and update this organization. If no ALI files are found on the Ada object path (See Section 1.3), the new object and ALI files are created in the directory containing the source being compiled. If another organization is desired, where objects and sources are kept in different directories, a useful technique is to create dummy ALI files in the desired directories. These are dummy files, so gnatmake will be forced to recompile the corresponding source files, but it will be put the resulting object and ALI files in the location where it found the dummy file.

-m

Specifies that the minimum necessary amount of re-compilation be performed. Ignore time stamp differences when the only modifications to a source file consist in adding/removing comments, empty lines, spaces or tabs. This means that if you have changed the comments in a source file or have simply reformatted it, using this switch will tell gnatmake not to recompile files that depend on it (provided other sources on which these files depend have undergone no semantic modifications).

-n

Don't compile, bind, or link. Checks if all objects are up to date. If they are not the full name of the first file that needs to be recompiled is printed. Repeated use of this option, followed by compiling the indicated source file, will eventually result in recompiling all required units.

-o exec_name

Output executable name. The name of the final executable program will be exec_name. If the -o switch is omitted the default name for the executable will be the name of the input file in appropriate form for an executable file.

-q

Quiet. When this flag is not set, the commands carried out by gnatmake are displayed.

-v

Verbose. Displays the reason for all recompilations gnatmake decides are necessary.

gcc switches

The switch -g or any uppercase switch (other than -A, or -L) or any switch that is more than one character is passed to gcc (e.g. -O, -gnato, etc.)

Source and library search path switches:

-aIdir

When looking for source files also look in directory dir. The order in which source files search is undertaken is described in Section 1.3.

-aLdir

Consider dir as being an externally provided Ada library. Instructs gnatmake to skip compilation units whose .ali files have been located in directory dir. This allows you to have missing bodies for the units in dir. You still need to specify the location of the specs for these units by using the switches -aIdir or -Idir. Note: this switch is provided for compatibility with previous versions of gnatmake. The easier method of causing standard libraries to be excluded from consideration is to write protect the corresponding ALI files.

-aOdir

When searching for library and object files, look in directory dir. The order in which library files are searched is described in Section 2.8.

-Adir

Equivalent to -aLdir -aIdir.

-Idir

Equivalent to -aOdir -aIdir.

-I-

Do not look for source files in the directory containing the source file named in the command line. Do not look for ALI or object files in the directory where gnatmake was invoked.

-Ldir

Add directory dir to the list of directories in which the linker will search for libraries. This is equivalent to -largs -Ldir.