home *** CD-ROM | disk | FTP | other *** search
- --------------------------------------------------------------------
- Lattice AmigaDOS C 5.0 Driver Version 2.0
- Copyright © 1990 by Tyger Mohrtech Software Revised 01/22/90
- --------------------------------------------------------------------
-
- Here it is: a Unix "cc"-like driver for Lattice C 5.X!
-
- I wrote this program because I got fed up with Lattice's "lc"
- driver program, especially when trying to convert makefiles (for
- MicroEMACS) to use lc instead of the universal "cc" type driver.
-
- NOTE: "tmskludge" is GONE! The program now requires Arp.library
- to run, but you should all have Arp anyway. It should be
- available almost anywhere.
-
- Besides the removal of tmskludge, new improvements include easier
- configurability (?), slightly more Unix-like syntax, base-relative
- code support, and more!
-
- The cc program is now "pure" so that it may be made resident. If your
- distribution's cc does not have it's p(ure) bit set, you can set it with
- "protect cc +p" from a CLI shell. Other shells may provide alternate
- ways of doing this.
-
- The format for a cc command is
-
- cc [options] file [file [file ...]]
-
- A file is as follows:
-
- foo.c will be compiled to foo.o and linked*
- foo.a will be assembled to foo.o and linked*
- foo.s will be assembled to foo.o and linked*
- foo.o will be linked*
- foo.lib will be linked*
-
- *linking will not take place if the -c option is specified (see below).
- The .a option should now work right, and .s as an alternate (more
- Unix-like) file suffix for assembly files is now supported
-
- The options are as follows:
-
- NOTE: they are now case-sensitive, and options with an argument (e.g.
- "-o foo" or "-l foo") can now be written as "-ofoo" or "-lfoo" as well.
-
- -c Don't link
-
- Unless this option is specified, the resulting object files
- and any specified libraries files will be linked along with
- amiga.lib and lc.lib to produce an executable file.
-
- -d Produce CPR debugging info
-
- This option will create the necesary information so that the
- program can be debugged with CPR. See the note on configuration
- files at the end of this file.
-
- -x Produce linker xref file
-
- This option causes "file.xrf" to be generated, containing the
- Blink xref output. See the note on configuration files at the
- end of this file.
-
- -m Produce linker map file
-
- This option causes "file.map" to be generated, containing the
- Blink map output. See the note on configuration files at the
- end of this file.
-
- -O Run the optimizer
-
- This option will cause all .c files to be optimized with
- Lattice's optimizer. See the note on configuration files
- at the end of this file.
-
- -B Use the big compiler
-
- This probably isn't very useful right now, but it does work. It
- causes cc to use lc1b instead of lc1. See the note on
- configuration files at the end of this file.
-
- -b Generate base register relative code
-
- This causes the compiler to use base register relative
- addressing. It is the same as the -b1 option to lc. See the
- note on configuration files at the end of this file.
-
- -s Don't generate stack checking code
-
- This will cause "fast and dangerous" non stack-checked code to
- be generated. It will make programs smaller and faster, but
- don't use it unless your program is working 100% debugged. (you
- may not want to use it even then). See the note on configuration
- files at the end of this file.
-
- -D x
- -D x=6
- -D x.6 Define symbol
-
- Causes "x" do be defined as if your source file contained:
-
- -D x #define x
- -D x=6 #define x 6
- -D x.6 #define x 6
-
- The alternate "." syntax is provided beacuse some shells
- interpret the character = differently.
-
- -k Keep (don't delete) linkfile
-
- This will cause the linkfile generated by cc to be preserved. It
- is useful for debugging cc, as well as other things.
-
- -vx,-v Set verbosity to level x, 0 <= x <= 3 (-v == -v1)
-
- This sets how much progress information will be printed
- onscreen. -v and -v1 are the same. You should expirement with
- this to see what each level does. See the note on configuration
- files at the end of this file.
-
- -r1,-r Make a resident program with cres.o
-
- This will make a "pure" program that can be made resident. For
- some programs this will not work, and Blink will say "Absolute
- reference to..." In this case the resulting program will guru if
- executed. This can be corrected by including <proto/*.h> files
- for Amiga.lib functions that you use.
-
- -r2 Make a resident program with catchres.o
-
- This is similar to -r, but uses catchres.o instead of
- cres.o (or c.o of no -r option is specified)
-
- -r3 Make a resident program with catchresnr.o
-
- Same as above but uses catchresnr.o instead.
-
- -r4 Make a TSR (LSR) program with cback.o
-
- This is used to make programs like POPCLI3 or like SideKick on
- MS-DOS machines.
-
- -l Link with library
-
- This is a no longer a no-op. "-l z" will link with lib:z.lib.
- Note that lib files will be searched in the following order:
-
- -l foo
- foo.lib
- Floating point math libraries
- lc.lib
- amiga.lib
-
- -f use default floating point
- -fieee use Lattice IEEE emulator
- -flib use Amiga IEEE.Library routines
- -ffp use Motarola FFP emulator
- -f881 generate MC68881 code
-
- Specifies that your program uses floating-point math. See your
- Lattice manual for the ins and outs of each method. Note that
- -f uses the method specified in your configuration file. See
- the note on configuration files at the end of this file. The
- old -m (math, not map) option has been removed, and it's now
- implied by any of the switches.
-
- -o Specify output file
-
- By default, the executable program produced will have the same
- name as the first file on the command line, less the extension.
- For example, "cc foo.c zxc.a qwerty.o" will produce the
- executable "foo". If this had been "cc foo.c zxc.a qwerty.o -o
- outprog" than the executable would be called outprog instead.
-
- Configuration files:
-
- The cc program now reads a file on startup to determine default
- actions. This file is named "tmscc.cfg". CC will first search the
- current directory for this file, then look in s:. If it isn't found in
- s:, builtin defaults will be used. Note that some options to cc reverse
- their meaning if tmscc.cfg is changed, for example -O becomes "don't
- optimize" if optimization is selected as the default in tmscc.cfg.
- I will now go through and explain the included tmscc.cfg file.
-
- 1 if no -o, output to first filename less .c? (0 == a.out)
-
- If -o <something> is specified, then <something> will be the name of the
- executable that is produced. This option specifies what it will be
- called if -o isn't specified. If 0, it will be called "a.out" like under
- Unix. If 1, then it will have the name of the first source or object
- file less it's extension.
-
- 0 optimize?
-
- This determines if the compiler will optimize as a default. 0 = don't
- optimize by default, 1 = do. Setting this to 1 reverses the meaning of
- the -O switch
-
- 0 CPR debugging info?
-
- This determines if the compiler will produce debugging information for
- CodePRobe as a default. 0 = don't, 1 = do. Setting this to 1 reverses
- the meaning of the -d switch
-
- 1 store .q and .lnk files in QUAD:?
-
- If this is 1 then .q and .lnk temporary files will be kept wherever the
- QUAD: device is ASSIGNed to. If 0, they will be kept in the current
- directory.
-
- 0 default verbosity level
-
- This sets which verbosity level is the default. 0 to 3 are the valid
- levels. See the discussion of the -v switches above.
-
- 1 show sign-on message?
-
- If 0, the version/copyright banner will not be displayed.
-
- 0 make xref file?
-
- If 1 then a Blink .xrf file will be produced. This reverses the meaning
- of the -x option. See the -x option above for details.
-
- 0 make map file?
-
- If 1 then a Blink .map file will be produced. This reverses the meaning
- of the -m option. See the -m option above for details.
-
- cdtuw for -c option on lc1 (see Lattice manual)
-
- This specifies which options to send to the lc1 pass via the -c switch.
- This example turns on nested comments (c), allows $ to be used in
- identifiers (d), warns if a structure type is used before defined (t),
- causes chars to be unsigned (u), and dosn't generate a warning if an int
- function dosn't return a value (handy for dealing with old source code).
- For the best error checking and code generation, Lattice says to use
- "usf". "a" may be used for ANSI compatibility. For other options, see
- your Lattice Manual.
-
- 0 generate code for 680x0 where x = the number starting this line
-
- See the Lattice manual under the -m switch. Note that the letter options
- aren't yet supported.
-
- 0 use the big compiler?
-
- Causes lc1b rather than lc1 to be used by default. Reverses the meaning
- of the -B switch.
-
- 0 generate base register offset code?
-
- Causes base-relative code to be generated by default. Reverses the
- meaning of -b. See the Lattice manual under -b0/-b1 for details
-
- 1 generate stack checking code?
-
- If 0, no stack checking code will be generated. If 0, reverses the
- meaning of the -s switch.
-
- 2 debugging level to invoke on -d option (1 to 5)
-
- Sets which -dn (n = 1 to 5) switch is to be passed to lc1 when cc
- encounters the -d option. 2 is good for normal use.
-
- 0 floating point math default 0=IEEE 1=IEEE.LIBRARY 2=FFP 3=881
-
- Sets which type of floating point math code is generated if -f (rather
- than one of the explicit -f options) is encountered. See the Lattice
- manual for the pro's and con's of each type.
-
- If you find this proram usefull, please send $15 or an Amiga 2500UX :-)
- to:
-
- Tyler Sarna
- 68 Jordan Ave.
- Brunswick, ME 04011
-
- Sparsly commented cryptic poory written :-) souce code is also available
- on request. If I get a request then I will try to comment and clean up
- the code first. If I get several requests then I will distribute the
- code by the same means that cc is distributed by.
-
- Feel free to distribute this program (you may not charge for it) through
- any means EXCEPT CompuServe. Apparently CompuServe claims to have total
- ownership of anything that is posted on its systems. Until I hear
- otherwise, this program may not be distributed by them. Also, you must
- include all files that come with cc.
-
- -Ty
-