afm2.1.src 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  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 \-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 \-_
  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(1ACK)-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. The \fB\-l\fIlib\fR, \fB\-d\fP, \fB\-n\fP, \fB\-N\fP,
  115. \fB\-r\fP, \fB\-s\fP, \fB\-S\fP, \fB\-i\fP, and \fB\-u\fP options are
  116. passed to the link-editor program.
  117. The \fB\-u\fP option takes an extra argument.
  118. .IP \fB\-c\fP
  119. .br
  120. Suppress the loading phase of the compilation, and force an object module to
  121. be produced, even if only one program is compiled.
  122. A single object module can be named explicitly using the
  123. .B \-o
  124. option.
  125. .IP \fB\-D\fIname\fR\fB=\fIdef\fR
  126. Define a symbol
  127. .I name
  128. to the
  129. preprocessor, as if by "#define".
  130. .IP \fB\-D\fIname\fR
  131. .br
  132. same as \fB\-D\fIname\fB=1\fR.
  133. .IP \fB\-I\fIpathname\fR
  134. .br
  135. Add
  136. .I pathname
  137. to the list of directories in which to search for
  138. .B #include
  139. files with filenames not beginning with slash.
  140. The preprocessor first searches for
  141. .B #include
  142. files in the directory containing
  143. .I sourcefile,
  144. then in directories in
  145. .B \-I
  146. options, then in the ACK include directory,
  147. and finally, in
  148. .I /usr/include.
  149. This flag is also passed to the compiler. When the compiler needs a definition
  150. module, it is first searched for in the current directory, then in the
  151. directories given to it by the \fB\-I\fP flag, and then in a default directory,
  152. .I CHANGE_ME.
  153. .I afm2
  154. This default directory contains all definition modules of
  155. the runtime system.
  156. .IP "\fB\-o \fIoutput\fR"
  157. Name the final output file
  158. .I output.
  159. .IP \fB\-O\fP
  160. .br
  161. Use a version of the compiler that is just a bit slower, but produces
  162. better code.
  163. .IP \fB\-U\fIname\fR
  164. .br
  165. Remove any initial definition of
  166. .I name.
  167. .IP \fB\-v\fP
  168. .br
  169. Verbose. Print the commands as they are executed.
  170. .IP \fB\-vn\fP
  171. .br
  172. Verbose, no execute. Only print the commands, do not execute them.
  173. .IP \fB\-L\fR
  174. do not generate code to keep track of
  175. the current location in the source code.
  176. .IP \fB\-w\fR\fIclasses\fR
  177. suppress warning messages whose class is a member of \fIclasses\fR.
  178. Currently, there are three classes: \fBO\fR, indicating old-flashioned use,
  179. \fBW\fR, indicating "ordinary" warnings, and \fBR\fR, indicating
  180. restricted Modula-2.
  181. If no \fIclasses\fR are given, all warnings are suppressed.
  182. By default, warnings in class \fBO\fR and \fBW\fR are given.
  183. .IP \fB\-W\fR\fIclasses\fR
  184. allow for warning messages whose class is a member of \fIclasses\fR.
  185. .IP \fB\-R\fP
  186. .br
  187. disable all range-checks.
  188. .IP \fB\-A\fP
  189. .br
  190. enable extra array bound checks. Unfortunately, the back-end used for this
  191. compiler is a bit sloppy, so extra array bound checks are needed if you want
  192. detection of array bound errors.
  193. .IP \fB\-3\fP
  194. .br
  195. Only accept Modula-2 programs that strictly conform to the 3rd Edition of
  196. [1].
  197. .IP \fB\-_\fP
  198. .br
  199. allow for underscores within identifiers. Identifiers may not start or end
  200. with an underscore, even if this flag is given.
  201. .IP \fB\-M\fIcompiler\fR
  202. .br
  203. use \fIcompiler\fR as Modula-2 compiler instead of the default.
  204. .SH "SEE ALSO"
  205. .IP [1]
  206. N. Wirth, \fIProgramming in Modula-2\fP, 3rd edition, Springer Verlag.
  207. .IP [2]
  208. C.J.H. Jacobs, \fIThe ACK Modula-2 Compiler\fP.
  209. .IP [3]
  210. ack(1ACK) unix manual page.
  211. .SH DIAGNOSTICS
  212. Diagnostics are intended to be self-explanatory.
  213. .SH REMARKS
  214. You need the 4th ACK distribution to be able to use this program.