afm2.1 4.8 KB

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