home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / compiler / vbcc / doc / vc.doc < prev    next >
Encoding:
Text File  |  1997-01-31  |  6.2 KB  |  170 lines

  1. vc - frontend for vbcc (c) in 1995-97 by Volker Barthelmann
  2.  
  3.  
  4. INTRODUCTION
  5.  
  6.     vc calls the preprocessor, compiler, assembler and linker.
  7.     It should be somewhat Unix cc compatible.
  8.  
  9.  
  10. LEGAL
  11.  
  12.     vc is (c) in 1995-97 by Volker Barthelmann. All code is written by me
  13.     and may be freely redistributed as long as no modifications are made
  14.     and nothing is charged for it.
  15.  
  16.  
  17. INSTALLATION
  18.  
  19.     This may change in following versions.
  20.  
  21.     First do not set your stack too low (if your operating systems needs
  22.     specifying a stack size). I have not tested how much stack vbcc needs,
  23.     some 10k will probably be enough.
  24.  
  25.     At the moment vc calls an external preprocessor, so this one must be
  26.     in the path and you probably have to tell the preprocessor the
  27.     directories that contain the vbcc includes (and any os includes, if you
  28.     have them).
  29.  
  30.     vc needs a config file which tells it how to call all the translation
  31.     phases (preprocessor, compiler, assembler, linker). The locations where
  32.     vc searches for config files depend on how it was compiled.
  33.     On the Amiga it will usually search for "vc.config" in the current
  34.     directory, then in ENV: and VBCC:.
  35.     On Unix it will search for vc.config in the current directory followed
  36.     by /etc/vc.config.
  37.     Those locations can be changed by modifying config_names in vc.c and
  38.     rebuilding it.
  39.  
  40.     The following options can be used to tell vc how to call the translation
  41.     phases (they will usually be contained in the config-file):
  42.  
  43.     -pp=string  The preprocessor will be called like in
  44.                 printf(string,opts,infile,outfile), e.g. the default for vcpp
  45.                 searching the includes in vinclude: and defining __STDC__)
  46.                 is "-pp=vcpp -Ivinclude: -D__STDC__=1 %s %s %s"
  47.  
  48.     -cc=string  For the compiler. Note that you cannot use vc to call
  49.                 another compiler than vbcc. But you can call different
  50.                 versions of vbcc this way, e.g.:
  51.                 "-cc=vbcca68k -quiet" or
  52.                 "-cc=vbcci386 -quiet"
  53.  
  54.     -as=string  The same for the assembler, E.g.:
  55.                 "-as=PhxAss opt NRQBTLPSM quiet %s to %s" or
  56.                 "-as=as %s -o %s"
  57.  
  58.     -rm=string  This is the string for the delete command and takes only
  59.                 one argument, e.g.
  60.                 "-rm=delete quiet %s" or
  61.                 "-rm=rm %s"
  62.  
  63.     -ld=string  This is for the linker and takes three arguments. The first
  64.                 one are the object files (separated by spaces), the second
  65.                 one the user specified libraries and the last one the name
  66.                 of the resulting executable.
  67.                 This has to link with proper startup-code and c-libraries,
  68.                 e.g.:
  69.                 "-ld=PhxLnk vlib:startup.o %s %s vlib:vc.lib vlib:amiga.lib
  70.                  to %s" or
  71.                 "-ld=ld /usr/lib/crt0.o %s %s -lc -o %s"
  72.  
  73.     -l2=string  The same like -ld, but standard-startup and -libraries should
  74.                 not be linked; used when -nostdlib is specified.
  75.  
  76.  
  77.     All those strings should tell the command to omit any output apart from
  78.     error messages if possible. However for every of those options there
  79.     exists one with an additional 'v', i.e. -ppv=, -asv=, etc. which should
  80.     produce some output, if possible.
  81.     If vc is invoked with the -vv option the verbose commands will be called,
  82.     if not the quiet ones will be used.
  83.  
  84.  
  85. CONFIG
  86.  
  87.     vc looks for a config file named 'vc.config' in the current directory
  88.     first and then in some other files which have been specified
  89.     while compiling vc (on the Amiga this will be ENV:vc.config then
  90.     VBCC:vc.config; on Unix systems /etc/vc.config). If it is found it will
  91.     be treated as a collection of additional command line arguments. Every
  92.     line of the file will be used as one argument. So no quoting shall be
  93.     used and furthermore must each argument be placed on its own line.
  94.     There should be an example vc.config.
  95.  
  96.     If the _first_ argument of vc is '+file' then <file> will be used as
  97.     config-file.
  98.  
  99.  
  100. USAGE
  101.  
  102.     vc [options] file1 file2 ...
  103.  
  104.     Processes all files according to their suffix and links all objects
  105.     together (unless any of -E, -S, -c is specified). It recognizes the
  106.     following file types:
  107.  
  108.     .c      C source
  109.     .i      already preprocessed C source
  110.     .asm
  111.     .s      assembler source
  112.     .obj
  113.     .o      object file
  114.  
  115.     Usually pattern matching is supported - however this depends on the
  116.     port and the host system.
  117.  
  118.     The options recognized by vc are:
  119.  
  120.     -v      verbose; print all commands
  121.  
  122.     -vv     very verbose; display some internals, aswell
  123.  
  124.     -Ox     optimization level
  125.             -O0 is equivalent to -O=0
  126.             -O  will activate some optimizations (at the moment -O=991)
  127.             -O2 will activate most optimizations (at the moment -O=1023)
  128.             -O3 will activate all  optimizations (at the moment -O=~0)
  129.  
  130.             Higher values may or may not activate even more optimizations.
  131.             The default is -O=1.
  132.             It is also possible to specify an exact value with -O=n.
  133.             However, I do not recommend this unless you know exactly what
  134.             you are doing.
  135.  
  136.     -o file save target as file (default for executables is a.out)
  137.  
  138.     -E      do not compile, save the preprocessed C sources with .i suffix
  139.  
  140.     -S      do not assemble, save the compiled files with .asm suffix
  141.  
  142.     -c      do not link, save the compiled files with .o suffix
  143.  
  144.     -k      keep all intermediate files; by default all generated files
  145.             except the source files and the targets are deleted
  146.  
  147.     -Dstr   #define a preprocessor symbol, e.g. -DAMIGA or -DCPU=68000;
  148.             at the moment this is passed through to the preprocessor
  149.  
  150.     -Ipath  add path to the include-search-path;
  151.             at the moment this is passed through to the preprocessor
  152.  
  153.     -lulib  link with library ulib
  154.  
  155.     -+      allow C++ comments
  156.  
  157.     -nostdlib   do not link with standard-startup/libraries; useful only
  158.                 for people who know what they are doing
  159.  
  160.     -notmpfile  do not use names from tmpnam() for temporary files
  161.  
  162.     +file   use file as config-file
  163.  
  164.  
  165.     All other options are passed through to vbcc.
  166.  
  167.  
  168. Volker                                                  volker@vb.franken.de
  169.  
  170.