cem.1 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. .TH CEM 1 local
  2. .SH NAME
  3. cem \- ACK C compiler
  4. .SH SYNOPSIS
  5. .B cem
  6. [ option ] ... file ...
  7. .SH DESCRIPTION
  8. .I Cem
  9. is a \fIcc\fP(1)-like
  10. C compiler that uses the C front-end compiler \fIcemcom\fP(1)
  11. of the Amsterdam Compiler Kit.
  12. .I Cem
  13. interprets its arguments not starting with a '\-' as
  14. source files, to be compiled by the various parts of the compilation process,
  15. which are listed below.
  16. File arguments whose names end with \fB.\fP\fIcharacter\fP are interpreted as
  17. follows:
  18. .IP .[ao]
  19. object file.
  20. .IP .[ci]
  21. C source code
  22. .IP .e
  23. EM assembler source file.
  24. .IP .k
  25. compact EM file, not yet optimised by the EM peephole optimiser.
  26. .IP .m
  27. compact EM file, already optimised by the peephole optimiser.
  28. .IP .s
  29. assembler file.
  30. .LP
  31. The actions to be taken by
  32. .I cem
  33. are directed by the type of file argument and the various options that are
  34. presented to it.
  35. .PP
  36. The following options, which is a mixture of options interpreted by \fIcc\fP(1)
  37. and \fIack\fP(?),
  38. are interpreted by
  39. .I cem .
  40. (The options not specified here are passed to the front-end
  41. compiler \fIcemcom\fP(1).)
  42. .IP \fB\-B\fP\fIname\fP
  43. Use \fIname\fP as front-end compiler instead of the default \fIcemcom\fP(1).
  44. .br
  45. Same as "\fB\-Rcem=\fP\fIname\fP".
  46. .IP \fB\-C\fP
  47. Run C preprocessor \fI/lib/cpp\fP only and prevent it from eliding comments.
  48. .IP \fB\-D\fP\fIname\fP\fB=\fP\fIdef\fP
  49. Define the \fIname\fP to the preprocessor, as if by "#define".
  50. .IP \fB\-D\fP\fIname\fP
  51. .br
  52. Same as "\fB\-D\fP\fIname\fP\fB=1\fP".
  53. .IP \fB\-E\fP
  54. Run only the macro preprocessor on the named files and send the
  55. result to standard output.
  56. .IP \fB\-I\fP\fIdir\fP
  57. \&"#include" files whose names do not begin with '/' are always
  58. sought first in the directory of the \fIfile\fP argument, then in directories
  59. in \fB\-I\fP options, then in directories on a standard list (which in fact
  60. consists of "/usr/include").
  61. .IP \fB\-L\fP\fIdir\fP
  62. Use \fIdir\fP as library-containing directory instead of the default.
  63. .IP \fB\-P\fP
  64. Same as \fB\-E\fP, but sending the result of input file \fIfile\fP\fB.[ceis]\fP
  65. to \fIfile\fP\fB.i\fP.
  66. .IP \fB\-R\fP
  67. Passed to \fIcemcom\fP(1) in order to parse the named C programs according
  68. to the C language as described in [K&R] (also called \fIRestricted\fP C).
  69. .IP \fB\-R\fP\fIprog\fP\fB=\fP\fIname\fP
  70. .br
  71. Use \fIname\fP as program for phase \fIprog\fP of the compilation instead of
  72. the default.
  73. \&\fIProg\fP is one of the following names:
  74. .RS
  75. .IP \fBcpp\fP
  76. macro preprocessor (default: /lib/cpp)
  77. .IP \fBcem\fP
  78. front\-end compiler (default: $CEM/bin/cemcom)
  79. .IP \fBopt\fP
  80. EM peephole optimiser (default: $EM/lib/em_opt)
  81. .IP \fBdecode\fP
  82. EM compact to EM assembler translator (default: $EM/lib/em_decode)
  83. .IP \fBencode\fP
  84. EM assembler to EM compact translator (default: $EM/lib/em_encode)
  85. .IP \fBbe\fP
  86. EM compact code to target\-machine assembly code compiler
  87. (default: $EM/lib/vax4/cg)
  88. .IP \fBcg\fP
  89. same as \fBbe\fP
  90. .IP \fBas\fP
  91. assembler (default: /bin/as)
  92. .IP \fBld\fP
  93. linker/loader (default: /bin/ld)
  94. .RE
  95. .IP \fB\-R\fP\fIprog\fP\fB\-\fP\fIoption\fP
  96. .br
  97. Pass \fB\-\fP\fIoption\fP to the compilation phase indicated by \fIprog\fP.
  98. .IP \fB\-S\fP
  99. Same as \fB\-c.s\fP.
  100. .IP \fB\-U\fP\fIname\fP
  101. .br
  102. Remove any initial definition of \fIname\fP.
  103. .IP \fB\-V\fP\fIcm\fP.\fIn\fP,\ \fB\-V\fIcm\fP.\fIncm\fP.\fIn\fP\ ...
  104. .br
  105. Set the size and alignment requirements of the C constructs of the named
  106. C input files.
  107. The letter \fIc\fP indicates the simple type, which is one of
  108. \fBs\fP(short), \fBi\fP(int), \fBl\fP(long), \fBf\fP(float), \fBd\fP(double) or
  109. \fBp\fP(pointer).
  110. The \fIm\fP parameter can be used to specify the length of the type (in bytes)
  111. and the \fIn\fP parameter for the alignment of that type.
  112. Absence of \fIm\fP or \fIn\fP causes the default value to be retained.
  113. To specify that the bitfields should be right adjusted instead of the
  114. default left adjustment, specify \fBr\fP as \fIc\fP parameter
  115. without parameters.
  116. .br
  117. This option is passed directly to \fIcemcom\fP(1).
  118. .IP \fB\-c\fP
  119. Same as \fB\-c.o\fP.
  120. .IP \fB\-c.e\fP
  121. Produce EM assembly code on \fIfile\fP\fB.e\fP for the
  122. named files \fIfile\fP\fB.[cikm]\fP
  123. .IP \fB\-c.k\fP
  124. Compile C source \fIfile\fP\fB.[ci]\fP or
  125. encode EM assembly code from \fIfile\fP\fB.e\fP
  126. into unoptimised compact EM code and write the result on \fIfile\fP\fB.k\fP
  127. .IP \fB\-c.m\fP
  128. Compile C source \fIfile\fP\fB.[ci]\fP,
  129. translate unoptimised EM code from \fIfile\fP\fB.k\fP or
  130. encode EM assembly code from \fIfile\fP\fB.e\fP
  131. into optimised compact EM code and write the result on \fIfile\fP\fB.m\fP
  132. .IP \fB\-c.o\fP
  133. Suppress the loading phase of the compilation, and force an object file to
  134. be produced even if only one program is compiled
  135. .IP \fB\-c.s\fP
  136. Compile the named \fIfile\fP\fB.[ceikm]\fP input files, and leave the
  137. assembly language output on corresponding files suffixed ".s".
  138. .IP \fB\-k\fP
  139. Same as \fB\-c.k\fP.
  140. .IP \fB\-l\fP\fIname\fP
  141. .br
  142. Append the library \fBlib\fP\fIname\fP\fB.a\fP to the list of files that
  143. should be loaded and linked into the final output file.
  144. The library is searched for in the library directory.
  145. .IP \fB\-m\fP
  146. Same as \fB\-c.m\fP.
  147. .IP \fB\-o\fP\ \fIoutput\fP
  148. .br
  149. Name the final output file \fIoutput\fP.
  150. If this option is used, the default "a.out" will be left undisturbed.
  151. .IP \fB\-p\fP
  152. Produce EM profiling code (\fBfil\fP and \fBlin\fP instructions to
  153. enable an interpreter to keep track of the current location in the
  154. source code)
  155. .IP \fB\-t\fP
  156. Keep the intermediate files, produced during the various phases of the
  157. compilation.
  158. The produced files are named \fIfile\fP\fB.\fP\fIcharacter\fP where
  159. \&\fIcharacter\fP indicates the type of the file as listed before.
  160. .IP \fB\-v\fP
  161. Verbose.
  162. Print the commands before they are executed.
  163. .IP \fB\-vn\fP
  164. Do not really execute (for debugging purposes only).
  165. .IP \fB\-vd\fP
  166. Print some additional information (for debugging purposes only).
  167. .IP \fB\-\-\fP\fIanything\f
  168. .br
  169. Equivalent to \fB\-Rcem\-\-\fP\fIanything\fP.
  170. The options
  171. .B \-\-C ,
  172. .B \-\-E
  173. and
  174. .B \-\-P
  175. all have the same effect as respectively
  176. .B \-C ,
  177. .B \-E
  178. and
  179. .B \-P
  180. except for the fact that the macro preprocessor is taken to be the
  181. built\-in preprocessor of the \fBcem\fP phase.
  182. Most "\-\-" options are used by
  183. .I cemcom (1)
  184. to set some internal debug switches.
  185. .IP loader\ options
  186. .br
  187. The options
  188. .B \-d ,
  189. .B \-e ,
  190. .B \-F ,
  191. .B \-n ,
  192. .B \-N ,
  193. .B \-r ,
  194. .B \-s ,
  195. .B \-u ,
  196. .B \-x ,
  197. .B \-X
  198. and
  199. .B \-z
  200. are directly passed to the loader.
  201. .SH FILES
  202. $CEM/bin/cem: this program
  203. .br
  204. $CEM/src/cem.c: C source of the \fBcem\fP program
  205. .br
  206. $CEM/bin/cemcom: C front end compiler
  207. .br
  208. $CEM/lib: default library-containing directory
  209. .br
  210. $CEM/src/cem.1: this manual page
  211. .br
  212. $CEM/src/cemcom.1: manual page for the C front end compiler
  213. .SH SEE ALSO
  214. cemcom(1), cc(1), ack(?), as(1), ld(1)
  215. .br
  216. .IP [K&R]
  217. B.W. Kernighan and D.M. Ritchie, \fIThe C Programming Language\fP,
  218. Prentice-Hall, 1978.
  219. .SH DIAGNOSTICS
  220. Any failure of one of the phases is reported.
  221. .SH NOTES
  222. .IP \(bu
  223. The names $CEM and $EM refer to the directories containing the CEM compiler
  224. and the ACK distribution tree respectively.
  225. .IP \(bu
  226. This manual page contains references to programs that reside on our site
  227. which is a VAX 11/750 running UNIX BSD4.1.
  228. Setting up \fBcem\fP requires some names to be declared in $CEM/src/cem.c
  229. .SH BUGS
  230. .IP \(bu
  231. All intermediate files are placed in the current working directory which
  232. causes files with the same name as the intermediate files to be overwritten.
  233. .IP \(bu
  234. .B Cem
  235. only accepts a limited number of arguments to be passed to the various phases.
  236. (e.g. 256).
  237. .IP \(bu
  238. Please report suggestions and other bugs to erikb@tjalk.UUCP