Next: , Up: The GNAT Make Program gnatmake


6.1 Running gnatmake

The usual form of the gnatmake command is

     
     
     
     $ gnatmake [switches] file_name
           [file_names] [mode_switches]

The only required argument is one file_name, which specifies a compilation unit that is a main program. Several file_names can be specified: this will result in several executables being built. If switches are present, they can be placed before the first file_name, between file_names or after the last file_name. If mode_switches are present, they must always be placed after the last file_name and all switches.

If you are using standard file extensions (.adb and .ads), then the extension may be omitted from the file_name arguments. However, if you are using non-standard extensions, then it is required that the extension be given. A relative or absolute directory path can be specified in a file_name, in which case, the input source file will be searched for in the specified directory only. Otherwise, the input source file will first be searched in the directory where gnatmake was invoked and if it is not found, it will be search on the source path of the compiler as described in Search Paths and the Run-Time Library (RTL).

All gnatmake output (except when you specify -M) is to stderr. The output produced by the -M switch is send to stdout.