home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fish 'n' More 2
/
fishmore-publicdomainlibraryvol.ii1991xetec.iso
/
fish
/
languages
/
northc_384
/
bin
/
cc.doc
< prev
next >
Wrap
Text File
|
1990-08-30
|
4KB
|
155 lines
(c) 1990 S.Hawtin.
Permission is granted to copy this file provided that:
1) It is not used for commercial gain
2) This notice is included in all copies
3) Altered copies are marked as such.
No liability is accepted for the contents of the file.
cc.doc within CC
CC
cc [-ofilename][-c][-s][-rlibdir][-llibname] file1 file2 ...
A front end for the 'C' language, it is used to control the compiler
assembler and linker. The options have the following meanings
-o<filename>
Write the linker output to the file <filename>.
-c
Compile and assemble the file, but do not link it.
-s
Compile the file but do not assemble it.
-?
Just test cc, if this flag is set the program will print out the commands
it would have executed. Useful for a quick play to see what cc does.
-n<flag>
Pass the flag to the NorthC program, for example "cc -n-c foo.c" will call
"NorthC -c foo.c".
-a<flag>
Pass the flag to the assembler.
-b<flag>
Pass the flag to the linker. Try using the flags "-bVERBOSE" and
"-bSMALLCODE" for example, see "blink.doc" for details.
-r<libdir>
Use the libraries in the <libdir> directory. NOTE the name of this
directory must end in ':' or '/' so that cc can just add filenames to it,
the default value is "clibs:". The "clibs:" logical device is initialised by
the "setup-NorthC" or "Single-Disk" script files.
-l<libname>
Link the library libname, libraries should be created with ar. As an
example "cc -lX11 foo.o" will use the file "clibs:libX11.a" as a library,
if you have such a library.
The types of the files are determined by thier extensions,
*.c A 'C' source file
*.i A preprocessed 'C' file
*.s An assembler file
*.asm An assembler file
all other input filenames are treated as object files. Because NorthC
does not have a seperate preprocessor stage *.i files are treated as
'C' source files. cc will delete any intermediate files that it produces,
this might cause problems if you have "foo.c" and "foo.s" as seperate
source files.
Some examples of this program in action will explain its behaviour,
cc ar.c
This command will compile, assemble and link the file "ar.c", this will
create a program "a.out". The intermediate files "ar.s" and "ar.o" will be
deleted once they have been used.
cc -c ar.c foo.asm
This command will compile and assemble the file "ar.c", creating a file
"ar.o". In addition it will assemble the file "foo.asm" creating a file
"foo.o". The -c option will prevent the cc program calling the linker.
cc -ofrob ar.o foo.o -lmylib
This command will link the files "ar.o" and "foo.o" with the library
"clibs:libmylib.a" to create an executable file "frob".
cc -ofrob -r:libs/libc/ ar.c foo.asm
This command will compile and assemble the file the file "ar.c", assemble
the file "foo.asm", then link the files ":libs/libc/crt0.o" "ar.o" and
"foo.o" with the library ":libs/libc/libc.a". The file "crt0.o" and the
library "libc.a" are always linked when cc calls the linker, they contain
the startup code for NorthC and the standard 'C' library.
cc -bSMALLCODE -ojim foo.o bar.o
This command will link the files "foo.o" and "bar.o", it will use the
command "blink clibs:crt0.o foo.o bar.o SMALLCODE TO jim LIB clibs:libc.a",
this allows you to pass flags to the linker that cc will not try to
interpret as filenames.
cc -? foo.c bar.c baz.asm
This command will not execute any system calls at all, the command will
print out a list of the commands it would have issued to perform this function.
This command is of most use when you have altered "cc.c" to test that it is
behaving as you expect. If you are interested in how cc works you should
use the "-?" flag.
FUTURE
Since I now have a version of "make" that does not call "cc" I do not
intend to do any more work on this program.
BUGS
The system() function does not return the exit code of the program it
calls. If one of the earlier tools fails cc will just carry on
regardless. This is because I have not got enough documentation on the
Amiga operating system to find out how to use Execute().
The extension comparison is case sensitive, a command "cc -c FOO.C" will
treat "FOO.C" as an object module.