fm2.1.src 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. .TH FM2 1
  2. .SH NAME
  3. fm2 \- fast CC compatible Modula-2 compiler
  4. .SH SYNOPSIS
  5. .B fm2
  6. [
  7. .B \-c
  8. ]
  9. [
  10. .B \-O
  11. ]
  12. [
  13. .B \-v
  14. ]
  15. [
  16. .B \-vn
  17. ]
  18. [ \fB\-D\fIname\fR ]
  19. [ \fB\-D\fIname\fB=\fIdef\fR ]
  20. [
  21. .BI \-I pathname
  22. ]
  23. [
  24. .BI \-w classes
  25. ]
  26. [
  27. .BI \-W classes
  28. ]
  29. [
  30. .B \-L
  31. ]
  32. [
  33. .B \-o
  34. .I outfile
  35. ]
  36. [
  37. .B \-R
  38. ]
  39. [
  40. .B \-A
  41. ]
  42. [
  43. .B \-3
  44. ]
  45. [
  46. .B \-U
  47. ]
  48. [
  49. .B \-e
  50. ]
  51. [
  52. .BI \-U name
  53. ]
  54. [
  55. .BI -M compiler
  56. ]
  57. .I sourcefile ...
  58. .SH DESCRIPTION
  59. .LP
  60. .I fm2
  61. is a fast
  62. .B Modula-2
  63. compiler. It translates
  64. .B Modula-2
  65. programs
  66. into cc(1)-compatible relocatable object modules, and does so in one pass.
  67. Then, if the \fB\-c\fP flag is not given,
  68. .I fm2
  69. offers the object modules to a link-editor,
  70. to create an executable binary.
  71. .LP
  72. .I Fm2
  73. accepts several types of filename arguments. Files with
  74. names ending in
  75. .B .mod
  76. are taken to be
  77. .B Modula-2
  78. source programs.
  79. They are compiled, and the resulting object module is placed in the current
  80. directory.
  81. The object module is named after its source file, the suffix
  82. .B .o
  83. replacing
  84. .BR .mod
  85. in the name of the object.
  86. A file with suffix
  87. .B .mod
  88. is passed through the C preprocessor if it begins with a '#'.
  89. .PP
  90. Definition modules are not separately compiled. The compiler reads them when
  91. it needs them.
  92. Definition modules are expected to reside in files with names ending
  93. in
  94. .BR .def .
  95. The name of the file in which a definition module is stored must be the same as
  96. the module-name, apart from the extension.
  97. Also, in most Unix systems filenames are only 14 characters long.
  98. So, given an IMPORT declaration for a module called "LongModulName",
  99. the compiler will try to open a file called "LongModulN.def".
  100. The requirement does not hold for implementation or program modules,
  101. but is certainly recommended.
  102. .LP
  103. Other arguments refer to loader options,
  104. object modules, or object libraries.
  105. Unless the
  106. .B \-c
  107. flag is given, these modules and libraries, together with the results of any
  108. specified compilations, are passed (in the order given) to the
  109. link-editor to produce
  110. an output file named
  111. .IR a.out .
  112. You can specify a name for the executable by using the
  113. .B \-o
  114. option.
  115. .LP
  116. If a single
  117. .B Modula-2
  118. program is compiled and loaded all at once, the object module
  119. file is deleted.
  120. .SH OPTIONS
  121. .LP
  122. The \fB\-l\fIlib\fR, \fB\-d\fP, \fB\-n\fP, \fB\-N\fP,
  123. \fB\-r\fP, \fB\-s\fP, \fB\-S\fP, \fB\-i\fP, and \fB\-u\fP options are
  124. passed to the link-editor program.
  125. The \fB\-u\fP option takes an extra argument.
  126. .IP \fB\-c\fP
  127. .br
  128. Suppress the loading phase of the compilation, and force an object module to
  129. be produced, even if only one program is compiled.
  130. A single object module can be named explicitly using the
  131. .B \-o
  132. option.
  133. .IP \fB\-D\fIname\fR\fB=\fIdef\fR
  134. Define a symbol
  135. .I name
  136. to the
  137. preprocessor, as if by "#define".
  138. .IP \fB\-D\fIname\fR
  139. .br
  140. same as \fB\-D\fIname\fB=1\fR.
  141. .IP \fB\-I\fIpathname\fR
  142. .br
  143. Add
  144. .I pathname
  145. to the list of directories in which to search for
  146. .B #include
  147. files with filenames not beginning with slash.
  148. The preprocessor first searches for
  149. .B #include
  150. files in the directory containing
  151. .I sourcefile,
  152. then in directories in
  153. .B \-I
  154. options, and finally, in
  155. .I /usr/include.
  156. This flag is also passed to the compiler. When the compiler needs a definition
  157. module, it is first searched for in the current directory, then in the
  158. directories given to it by the \fB\-I\fP flag, and then in a default directory,
  159. .I CHANGE_ME.
  160. .I fm2
  161. This default directory contains all definition modules of
  162. the runtime system.
  163. .IP "\fB\-o \fIoutput\fR"
  164. Name the final output file
  165. .I output.
  166. .IP \fB\-O\fP
  167. .br
  168. Use a version of the compiler that is just a bit slower, but produces
  169. better code.
  170. .IP \fB\-U\fIname\fR
  171. .br
  172. Remove any initial definition of
  173. .I name.
  174. .IP \fB\-v\fP
  175. .br
  176. Verbose. Print the commands as they are executed.
  177. .IP \fB\-vn\fP
  178. .br
  179. Verbose, no execute. Only print the commands, do not execute them.
  180. .IP \fB\-L\fR
  181. do not generate code to keep track of
  182. the current location in the source code.
  183. .IP \fB\-w\fR\fIclasses\fR
  184. suppress warning messages whose class is a member of \fIclasses\fR.
  185. Currently, there are three classes: \fBO\fR, indicating old-flashioned use,
  186. \fBW\fR, indicating "ordinary" warnings, and \fBR\fR, indicating
  187. restricted Modula-2.
  188. If no \fIclasses\fR are given, all warnings are suppressed.
  189. By default, warnings in class \fBO\fR and \fBW\fR are given.
  190. .IP \fB\-W\fR\fIclasses\fR
  191. allow for warning messages whose class is a member of \fIclasses\fR.
  192. .IP \fB\-R\fP
  193. .br
  194. disable all range-checks.
  195. .IP \fB\-A\fP
  196. .br
  197. enable extra array bound checks. Unfortunately, the back-end used for this
  198. compiler is a bit sloppy, so extra array bound checks are needed if you want
  199. detection of array bound errors.
  200. .IP \fB\-3\fP
  201. .br
  202. Only accept Modula-2 programs that strictly conform to the 3rd Edition of
  203. [1].
  204. .IP \fB\-U\fP
  205. .br
  206. allow for underscores within identifiers. Identifiers may not start or end
  207. with an underscore, even if this flag is given.
  208. .IP \fB\-e\fP
  209. .br
  210. allow for local extensions. Currently, the only local extensions are
  211. procedure constants.
  212. .IP \fB\-M\fIcompiler\fR
  213. .br
  214. use \fIcompiler\fR as Modula-2 compiler instead of the default.
  215. .PP
  216. The compiler does not do any version-control. Instead, a makefile
  217. generator,
  218. .IR m2mm ,
  219. is included.
  220. .SH "SEE ALSO"
  221. .IP [1]
  222. N. Wirth, \fIProgramming in Modula-2\fP, 3rd edition, Springer Verlag.
  223. .IP [2]
  224. C.J.H. Jacobs, \fIThe ACK Modula-2 Compiler\fP.
  225. .IP [3]
  226. cc(1) unix manual page.
  227. .IP [4]
  228. m2mm(1) manual page.
  229. .SH DIAGNOSTICS
  230. Diagnostics are intended to be self-explanatory.