home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 342b.lha / CC_v2.0 / cc.doc < prev    next >
Encoding:
Text File  |  1990-02-10  |  9.9 KB  |  291 lines

  1.   --------------------------------------------------------------------
  2.   Lattice AmigaDOS C 5.0 Driver                           Version  2.0
  3.   Copyright © 1990 by Tyger Mohrtech Software         Revised 01/22/90
  4.   --------------------------------------------------------------------
  5.  
  6.     Here it is: a Unix "cc"-like driver for Lattice C 5.X!
  7.  
  8.     I wrote this program because I got fed up with Lattice's "lc"
  9. driver program, especially when trying to convert makefiles (for
  10. MicroEMACS) to use lc instead of the universal "cc" type driver.
  11.  
  12. NOTE:    "tmskludge" is GONE! The program now requires Arp.library
  13.     to run, but you should all have Arp anyway. It should be
  14.     available almost anywhere.
  15.  
  16. Besides the removal of tmskludge, new improvements include easier
  17. configurability (?), slightly more Unix-like syntax, base-relative
  18. code support, and more!
  19.  
  20. The cc program is now "pure" so that it may be made resident. If your
  21. distribution's cc does not have it's p(ure) bit set, you can set it with
  22. "protect cc +p" from a CLI shell. Other shells may provide alternate
  23. ways of doing this.
  24.  
  25. The format for a cc command is
  26.  
  27.     cc [options] file [file [file ...]]
  28.  
  29. A file is as follows:
  30.  
  31.     foo.c will be compiled to foo.o and linked*
  32.     foo.a will be assembled to foo.o and linked*
  33.     foo.s will be assembled to foo.o and linked*
  34.     foo.o will be linked*
  35.     foo.lib will be linked*
  36.  
  37. *linking will not take place if the -c option is specified (see below).
  38. The .a option should now work right, and .s as an alternate (more
  39. Unix-like) file suffix for assembly files is now supported 
  40.  
  41. The options are as follows:
  42.  
  43. NOTE: they are now case-sensitive, and options with an argument (e.g.
  44. "-o foo" or "-l foo") can now be written as "-ofoo" or "-lfoo" as well. 
  45.  
  46. -c      Don't link
  47.  
  48.     Unless this option is specified, the resulting object files
  49.     and any specified libraries files will be linked along with
  50.     amiga.lib and lc.lib to produce an executable file.
  51.  
  52. -d    Produce CPR debugging info
  53.  
  54.     This option will create the necesary information so that the
  55.     program can be debugged with CPR. See the note on configuration
  56.     files at the end of this file.
  57.  
  58. -x      Produce linker xref file
  59.  
  60.     This option causes "file.xrf" to be generated, containing the
  61.     Blink xref output. See the note on configuration files at the
  62.     end of this file.
  63.  
  64. -m      Produce linker map file
  65.  
  66.     This option causes "file.map" to be generated, containing the
  67.     Blink map output. See the note on configuration files at the
  68.     end of this file.
  69.  
  70. -O      Run the optimizer
  71.  
  72.     This option will cause all .c files to be optimized with
  73.     Lattice's optimizer. See the note on configuration files
  74.     at the end of this file.
  75.  
  76. -B      Use the big compiler
  77.  
  78.     This probably isn't very useful right now, but it does work. It
  79.     causes cc to use lc1b instead of lc1. See the note on
  80.     configuration files at the end of this file.
  81.  
  82. -b      Generate base register relative code
  83.  
  84.     This causes the compiler to use base register relative
  85.     addressing. It is the same as the -b1 option to lc. See the
  86.     note on configuration files at the end of this file.
  87.  
  88. -s      Don't generate stack checking code
  89.  
  90.     This will cause "fast and dangerous" non stack-checked code to
  91.     be generated. It will make programs smaller and faster, but
  92.     don't use it unless your program is working 100% debugged. (you
  93.     may not want to use it even then). See the note on configuration
  94.     files at the end of this file.
  95.  
  96. -D x
  97. -D x=6
  98. -D x.6  Define symbol
  99.  
  100.     Causes "x" do be defined as if your source file contained:
  101.  
  102.         -D x        #define x
  103.         -D x=6      #define x 6
  104.         -D x.6      #define x 6
  105.  
  106.     The alternate "." syntax is provided beacuse some shells
  107.     interpret the character = differently. 
  108.  
  109. -k      Keep (don't delete) linkfile
  110.  
  111.     This will cause the linkfile generated by cc to be preserved. It
  112.     is useful for debugging cc, as well as other things.
  113.  
  114. -vx,-v  Set verbosity to level x, 0 <= x <= 3 (-v == -v1)
  115.  
  116.     This sets how much progress information will be printed
  117.     onscreen. -v and -v1 are the same. You should expirement with
  118.     this to see what each level does. See the note on configuration
  119.     files at the end of this file.
  120.  
  121. -r1,-r  Make a resident program with cres.o
  122.  
  123.     This will make a "pure" program that can be made resident. For
  124.     some programs this will not work, and Blink will say "Absolute
  125.     reference to..." In this case the resulting program will guru if
  126.     executed. This can be corrected by including <proto/*.h> files
  127.     for Amiga.lib functions that you use.
  128.  
  129. -r2    Make a resident program with catchres.o
  130.  
  131.     This is similar to -r, but uses catchres.o instead of
  132.     cres.o (or c.o of no -r option is specified)
  133.  
  134. -r3    Make a resident program with catchresnr.o
  135.  
  136.     Same as above but uses catchresnr.o instead.
  137.  
  138. -r4    Make a TSR (LSR) program with cback.o
  139.  
  140.     This is used to make programs like POPCLI3 or like SideKick on
  141.     MS-DOS machines. 
  142.  
  143. -l      Link with library
  144.  
  145.     This is a no longer a no-op. "-l z" will link with lib:z.lib.
  146.     Note that lib files will be searched in the following order: 
  147.  
  148.         -l foo
  149.         foo.lib
  150.         Floating point math libraries
  151.         lc.lib
  152.         amiga.lib
  153.  
  154. -f      use default floating point
  155. -fieee  use Lattice IEEE emulator
  156. -flib   use Amiga IEEE.Library routines
  157. -ffp    use Motarola FFP emulator
  158. -f881   generate MC68881 code
  159.  
  160.     Specifies that your program uses floating-point math. See your
  161.     Lattice manual for the ins and outs of each method. Note that
  162.     -f uses the method specified in your configuration file. See
  163.     the note on configuration files at the end of this file. The
  164.     old -m (math, not map) option has been removed, and it's now
  165.     implied by any of the switches.
  166.  
  167. -o      Specify output file
  168.  
  169.     By default, the executable program produced will have the same
  170.     name as the first file on the command line, less the extension.
  171.     For example, "cc foo.c zxc.a qwerty.o" will produce the
  172.     executable "foo". If this had been "cc foo.c zxc.a qwerty.o -o
  173.     outprog" than the executable would be called outprog instead.
  174.  
  175. Configuration files:
  176.  
  177.     The cc program now reads a file on startup to determine default
  178. actions. This file is named "tmscc.cfg". CC will first search the
  179. current directory for this file, then look in s:. If it isn't found in
  180. s:, builtin defaults will be used. Note that some options to cc reverse
  181. their meaning if tmscc.cfg is changed, for example -O becomes "don't
  182. optimize" if optimization is selected as the default in tmscc.cfg.
  183. I will now go through and explain the included tmscc.cfg file.
  184.  
  185. 1     if no -o, output to first filename less .c? (0 == a.out)
  186.  
  187. If -o <something> is specified, then <something> will be the name of the
  188. executable that is produced. This option specifies what it will be
  189. called if -o isn't specified. If 0, it will be called "a.out" like under
  190. Unix. If 1, then it will have the name of the first source or object
  191. file less it's extension.
  192.  
  193. 0     optimize?
  194.  
  195. This determines if the compiler will optimize as a default. 0 = don't
  196. optimize by default, 1 = do. Setting this to 1 reverses the meaning of
  197. the -O switch
  198.  
  199. 0     CPR debugging info?
  200.  
  201. This determines if the compiler will produce debugging information for
  202. CodePRobe as a default. 0 = don't, 1 = do. Setting this to 1 reverses
  203. the meaning of the -d switch
  204.  
  205. 1     store .q and .lnk files in QUAD:?
  206.  
  207. If this is 1 then .q and .lnk temporary files will be kept wherever the
  208. QUAD: device is ASSIGNed to. If 0, they will be kept in the current
  209. directory.
  210.  
  211. 0     default verbosity level
  212.  
  213. This sets which verbosity level is the default. 0 to 3 are the valid
  214. levels. See the discussion of the -v switches above.
  215.  
  216. 1     show sign-on message?
  217.  
  218. If 0, the version/copyright banner will not be displayed.
  219.  
  220. 0     make xref file?
  221.  
  222. If 1 then a Blink .xrf file will be produced. This reverses the meaning
  223. of the -x option. See the -x option above for details.
  224.  
  225. 0     make map file?
  226.  
  227. If 1 then a Blink .map file will be produced. This reverses the meaning
  228. of the -m option. See the -m option above for details.
  229.  
  230. cdtuw for -c option on lc1 (see Lattice manual)
  231.  
  232. This specifies which options to send to the lc1 pass via the -c switch.
  233. This example turns on nested comments (c), allows $ to be used in
  234. identifiers (d), warns if a structure type is used before defined (t),
  235. causes chars to be unsigned (u), and dosn't generate a warning if an int
  236. function dosn't return a value (handy for dealing with old source code).
  237. For the best error checking and code generation, Lattice says to use
  238. "usf". "a" may be used for ANSI compatibility. For other options, see
  239. your Lattice Manual. 
  240.  
  241. 0     generate code for 680x0 where x = the number starting this line 
  242.  
  243. See the Lattice manual under the -m switch. Note that the letter options
  244. aren't yet supported.
  245.  
  246. 0     use the big compiler?
  247.  
  248. Causes lc1b rather than lc1 to be used by default. Reverses the meaning
  249. of the -B switch.
  250.  
  251. 0     generate base register offset code?
  252.  
  253. Causes base-relative code to be generated by default. Reverses the
  254. meaning of -b. See the Lattice manual under -b0/-b1 for details
  255.  
  256. 1     generate stack checking code?
  257.  
  258. If 0, no stack checking code will be generated. If 0, reverses the
  259. meaning of the -s switch.
  260.  
  261. 2     debugging level to invoke on -d option (1 to 5)
  262.  
  263. Sets which -dn (n = 1 to 5) switch is to be passed to lc1 when cc
  264. encounters the -d option. 2 is good for normal use.
  265.  
  266. 0     floating point math default 0=IEEE 1=IEEE.LIBRARY 2=FFP 3=881
  267.  
  268. Sets which type of floating point math code is generated if -f (rather
  269. than one of the explicit -f options) is encountered. See the Lattice
  270. manual for the pro's and con's of each type.
  271.  
  272. If you find this proram usefull, please send $15 or an Amiga 2500UX :-)
  273. to:
  274.  
  275.     Tyler Sarna
  276.     68 Jordan Ave.
  277.     Brunswick, ME 04011
  278.  
  279. Sparsly commented cryptic poory written :-) souce code is also available
  280. on request. If I get a request then I will try to comment and clean up
  281. the code first. If I get several requests then I will distribute the
  282. code by the same means that cc is distributed by.
  283.  
  284. Feel free to distribute this program (you may not charge for it) through
  285. any means EXCEPT CompuServe. Apparently CompuServe claims to have total
  286. ownership of anything that is posted on its systems. Until I hear
  287. otherwise, this program may not be distributed by them. Also, you must
  288. include all files that come with cc.
  289.  
  290.                     -Ty
  291.