3.3.4.1 Arbitrary File Naming Conventions

The GNAT compiler must know the source file name of a compilation unit in order to compile it. When using the standard GNAT default file naming conventions (.ads for specs, .adb for bodies), it does not need additional information.

When the source file names do not follow the standard GNAT default file naming conventions, you must give the GNAT compiler additional information through a configuration pragmas file (Configuration Pragmas) or a project file. When the non-standard file naming conventions are well-defined, a small number of pragmas Source_File_Name specifying a naming pattern (Alternative File Naming Schemes) may be sufficient. However, if the file naming conventions are irregular or arbitrary, you must define a number of pragma Source_File_Name for individual compilation units. To help maintain the correspondence between compilation unit names and source file names within the compiler, GNAT provides a tool gnatname to generate the required pragmas for a set of files.