Next: , Previous: , Up: Top   [Contents][Index]


6 File naming conventions

Mercury source files must have a name that ends with the .m extension. Each other kind of files (documented below) is identified by its own extension.

For source files, the part of the filename before the .m extension can be anything, It is simplest if it is the full name of the module contained in the file, because if it isn’t, for any module in a program, then you will need to tell the compiler to construct a module-name-to-filename map. You can do this using a command such as mmc -f *.m (if all the source files in the program are in the current directory).

For all the other kinds files mentioned in this chapter, which are always constructed automatically by the Mercury compiler, the part of the filename before the suffix will be the fully qualified name of the module that the file belongs to.

For historical reasons, the default behaviour is for these files to be created in the current directory. However, if you use the ‘--use-subdirs’ option to ‘mmc’ or ‘mmake’, all these intermediate files will be created in a Mercury subdirectory, where you can happily ignore them. (With ‘mmc --make’, ‘--use-subdirs’ is the default.)

The rest of this chapter lists the extensions used by the files automatically generated by the Mercury compiler. It also briefly introduces their roles. This is just in case you are interested. You don’t actually need to know anything about them; if you want, you can skip now to the next chapter.


Next: , Previous: , Up: Top   [Contents][Index]