]> git.sur5r.net Git - cc65/blobdiff - doc/cl65.sgml
Add the ltest module to the makefile
[cc65] / doc / cl65.sgml
index c521b2d376cf81225ef556316c0e61fa5f51fac7..42eacee3a1264b52443bdcb4e332fa3e22077a46 100644 (file)
@@ -7,8 +7,8 @@
 
 <abstract>
 cl65 is the compile &amp; link utility for cc65, the 6502 C compiler. It was
 
 <abstract>
 cl65 is the compile &amp; link utility for cc65, the 6502 C compiler. It was
-designed as a smart frontend for the C compiler (cc65), the assembler (ca65)
-and the linker (ld65).
+designed as a smart frontend for the C compiler (cc65), the assembler (ca65),
+the object file converter (co65), and the linker (ld65).
 </abstract>
 
 <!-- Table of contents -->
 </abstract>
 
 <!-- Table of contents -->
@@ -18,72 +18,99 @@ and the linker (ld65).
 
 <sect>Overview<p>
 
 
 <sect>Overview<p>
 
-cl65 is a frontend for cc65, ca65 and ld65. While you may not use the full
-power of the tools when calling them through cl65, most features are
+cl65 is a frontend for cc65, ca65, co65 and ld65. While you may not use the
+full power of the tools when calling them through cl65, most features are
 available, and the use of cl65 is much simpler.
 
 
 <sect>Basic Usage<p>
 
 available, and the use of cl65 is much simpler.
 
 
 <sect>Basic Usage<p>
 
-The cl65 compile and link utility may be used to compile, assemble and
-link files. While the separate tools do just one step, cl65 knows how to
-build object files from C files (by calling the compiler, then the
-assembler) and other things.
+The cl65 compile and link utility may be used to convert, compile, assemble
+and link files. While the separate tools do just one step, cl65 knows how to
+build object files from C files (by calling the compiler, then the assembler)
+and other things.
 
 <tscreen><verb>
 ---------------------------------------------------------------------------
 
 <tscreen><verb>
 ---------------------------------------------------------------------------
-Usage: cl65 [options] file
+Usage: cl65 [options] file [...]
 Short options:
 Short options:
-  -c                    Compiler and assemble but don't link
-  -d                    Debug mode
-  -g                    Add debug info
-  -h                    Help (this text)
-  -l                    Create an assembler listing
-  -m name               Create a map file
-  -o name               Name the output file
-  -t sys                Set the target system
-  -v                    Verbose mode
-  -vm                   Verbose map file
-  -A                    Strict ANSI mode
-  -C name               Use linker config file
-  -Cl                   Make local variables static
-  -D sym[=defn]         Define a preprocessor symbol
-  -I dir                Set a compiler include directory path
-  -Ln name              Create a VICE label file
-  -O                    Optimize code
-  -Oi                   Optimize code, inline functions
-  -Or                   Optimize code, honour the register keyword
-  -Os                   Optimize code, inline known C funtions
-  -S                    Compile but don't assemble and link
-  -T                    Include source as comment
-  -V                    Print the version number
-  -W                    Suppress warnings
+  -c                   Compile and assemble but don't link
+  -d                   Debug mode
+  -g                   Add debug info
+  -h                   Help (this text)
+  -l                   Create an assembler listing
+  -m name              Create a map file
+  -mm model            Set the memory model
+  -o name              Name the output file
+  -r                   Enable register variables
+  -t sys               Set the target system
+  -v                   Verbose mode
+  -vm                  Verbose map file
+  -C name              Use linker config file
+  -Cl                  Make local variables static
+  -D sym[=defn]                Define a preprocessor symbol
+  -I dir               Set a compiler include directory path
+  -L path              Specify a library search path
+  -Ln name             Create a VICE label file
+  -O                   Optimize code
+  -Oi                  Optimize code, inline functions
+  -Or                  Optimize code, honour the register keyword
+  -Os                  Optimize code, inline known C funtions
+  -S                   Compile but don't assemble and link
+  -T                   Include source as comment
+  -V                   Print the version number
+  -W                   Suppress warnings
+  -Wa options          Pass options to the assembler
+  -Wl options          Pass options to the linker
 
 Long options:
 
 Long options:
-  --add-source          Include source as comment
-  --ansi                Strict ANSI mode
-  --asm-include-dir dir Set an assembler include directory
-  --bss-name seg        Set the name of the BSS segment
-  --check-stack         Generate stack overflow checks
-  --code-name seg       Set the name of the CODE segment
-  --codesize x          Accept larger code by factor x
-  --cpu type            Set cpu type
-  --create-dep          Create a make dependency file
-  --data-name seg       Set the name of the DATA segment
-  --debug               Debug mode
-  --debug-info          Add debug info
-  --feature name        Set an emulation feature
-  --help                Help (this text)
-  --include-dir dir     Set a compiler include directory path
-  --listing             Create an assembler listing
-  --mapfile name        Create a map file
-  --rodata-name seg     Set the name of the RODATA segment
-  --signed-chars        Default characters are signed
-  --start-addr addr     Set the default start address
-  --static-locals       Make local variables static
-  --target sys          Set the target system
-  --version             Print the version number
-  --verbose             Verbose mode
+  --add-source         Include source as comment
+  --asm-args options   Pass options to the assembler
+  --asm-define sym[=v] Define an assembler symbol
+  --asm-include-dir dir        Set an assembler include directory
+  --bss-label name     Define and export a BSS segment label
+  --bss-name seg       Set the name of the BSS segment
+  --cfg-path path      Specify a config file search path
+  --check-stack                Generate stack overflow checks
+  --code-label name    Define and export a CODE segment label
+  --code-name seg      Set the name of the CODE segment
+  --codesize x         Accept larger code by factor x
+  --config name                Use linker config file
+  --cpu type           Set cpu type
+  --create-dep         Create a make dependency file
+  --data-label name    Define and export a DATA segment label
+  --data-name seg      Set the name of the DATA segment
+  --debug              Debug mode
+  --debug-info         Add debug info
+  --feature name       Set an emulation feature
+  --forget-inc-paths   Forget include search paths (compiler)
+  --help               Help (this text)
+  --include-dir dir    Set a compiler include directory path
+  --ld-args options    Pass options to the linker
+  --lib file           Link this library
+  --lib-path path      Specify a library search path
+  --list-targets       List all available targets
+  --listing            Create an assembler listing
+  --list-bytes n       Number of bytes per assembler listing line
+  --mapfile name       Create a map file
+  --memory-model model Set the memory model
+  --module             Link as a module
+  --module-id id       Specify a module id for the linker
+  --o65-model model    Override the o65 model
+  --obj file           Link this object file
+  --obj-path path      Specify an object file search path
+  --register-space b   Set space available for register variables
+  --register-vars      Enable register variables
+  --rodata-name seg    Set the name of the RODATA segment
+  --signed-chars       Default characters are signed
+  --standard std       Language standard (c89, c99, cc65)
+  --start-addr addr    Set the default start address
+  --static-locals      Make local variables static
+  --target sys         Set the target system
+  --version            Print the version number
+  --verbose            Verbose mode
+  --zeropage-label name        Define and export a ZEROPAGE segment label
+  --zeropage-name seg  Set the name of the ZEROPAGE segment
 ---------------------------------------------------------------------------
 </verb></tscreen>
 
 ---------------------------------------------------------------------------
 </verb></tscreen>
 
@@ -128,9 +155,29 @@ There are a few remaining options that control the behaviour of cl65:
   The default for this option is different from the compiler and linker in the
   case that the option is missing: While the other tools (compiler, assembler
   and linker) will use the "none" system settings by default, cl65 will use
   The default for this option is different from the compiler and linker in the
   case that the option is missing: While the other tools (compiler, assembler
   and linker) will use the "none" system settings by default, cl65 will use
-  the C64 as a target system by default. This was choosen since most people
+  the C64 as a target system by default. This was chosen since most people
   seem to use cc65 to develop for the C64.
 
   seem to use cc65 to develop for the C64.
 
+  <tag><tt>-Wa options, --asm-args options</tt></tag>
+
+  Pass options directly to the assembler. This may be used to pass options
+  that aren't directly supported by cl65. Several options may be separated by
+  commas, the commas are replaced by spaces when passing them to the
+  assembler. Beware: Passing arguments directly to the assembler may interfere
+  with some of the defaults, because cl65 doesn't parse the options passed. So
+  if cl65 supports an option by itself, do not pass this option to the
+  assembler by means of the <tt/-Wa/ switch.
+
+  <tag><tt>-Wl options, --ld-args options</tt></tag>
+
+  Pass options directly to the linker. This may be used to pass options that
+  aren't directly supported by cl65. Several options may be separated by
+  commas, the commas are replaced by spaces when passing them to the linker.
+  Beware: Passing arguments directly to the linker may interfere with some of
+  the defaults, because cl65 doesn't parse the options passed. So if cl65
+  supports an option by itself, do not pass this option to the linker by means
+  of the <tt/-Wl/ switch.
+
 </descrip>
 
 
 </descrip>
 
 
@@ -156,6 +203,20 @@ package, it tries to be smart about several things.
        cases, just give the name of your "main" file as first input file.
 </itemize>
 
        cases, just give the name of your "main" file as first input file.
 </itemize>
 
+The type of an input file is derived from its extension:
+
+<itemize>
+<item>C files: <tt/.c/
+<item>Assembler files: <tt/.s/, <tt/.asm/, <tt/.a65/
+<item>Object files: <tt/.o/ <tt/.obj/
+<item>Libraries: <tt/.a/, <tt/.lib/
+<item>GEOS resource files: <tt/.grc/
+<item>o65 files: <tt/.o65/, <tt/.emd/, <tt/.joy/, <tt/.tgi/
+</itemize>
+
+Please note that the program cannot handle input files with unknown file
+extensions.
+
 
 <sect>Examples<p>
 
 
 <sect>Examples<p>
 
@@ -198,7 +259,7 @@ free to contact me by email (<htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org
 
 <sect>Copyright<p>
 
 
 <sect>Copyright<p>
 
-cl65 (and all cc65 binutils) are (C) Copyright 1998-2000 Ullrich von
+cl65 (and all cc65 binutils) are (C) Copyright 1998-2004 Ullrich von
 Bassewitz. For usage of the binaries and/or sources the following
 conditions do apply:
 
 Bassewitz. For usage of the binaries and/or sources the following
 conditions do apply: