📄 cl65-2.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><HTML><HEAD> <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20"> <TITLE>cl65 Users Guide: Basic Usage</TITLE> <LINK HREF="cl65-3.html" REL=next> <LINK HREF="cl65-1.html" REL=previous> <LINK HREF="cl65.html#toc2" REL=contents></HEAD><BODY><A HREF="cl65-3.html">Next</A><A HREF="cl65-1.html">Previous</A><A HREF="cl65.html#toc2">Contents</A><HR><H2><A NAME="s2">2.</A> <A HREF="cl65.html#toc2">Basic Usage</A></H2><P>The cl65 compile and link utility may be used to convert, compile, assembleand link files. While the separate tools do just one step, cl65 knows how tobuild object files from C files (by calling the compiler, then the assembler)and other things.</P><P><BLOCKQUOTE><CODE><PRE>---------------------------------------------------------------------------Usage: cl65 [options] file [...]Short options: -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 -o name Name the output file -r Enable register variables -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 -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 warningsLong options: --add-source Include source as comment --ansi Strict ANSI mode --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 --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 --help Help (this text) --include-dir dir Set a compiler include directory path --lib file Link this library --lib-path path Specify a library search path --listing Create an assembler listing --mapfile name Create a map file --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 --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---------------------------------------------------------------------------</PRE></CODE></BLOCKQUOTE></P><P>Most of the options have the same meaning than the corresponding compiler,assembler or linker option. See the documentation for these tools for anexplanation. If an option is available for more than one of the tools, itis set for all tools, where it is available. One example for this is <CODE>-v</CODE>:The compiler, the assembler and the linker are all called with the <CODE>-v</CODE>switch.</P><P>There are a few remaining options that control the behaviour of cl65:</P><P><DL><DT><B><CODE>-S</CODE></B><DD><P>This option forces cl65 to stop after the assembly step. This means thatC files are translated into assembler files, but nothing more is done.Assembler files, object files and libraries given on the command lineare ignored.</P><DT><B><CODE>-c</CODE></B><DD><P>This options forces cl65 to stop after the assembly step. This meansthat C and assembler files given on the command line are translated intoobject files, but there is no link step, and object files and librariesgiven on the command line are ignored.</P><DT><B><CODE>-o name</CODE></B><DD><P>The -o option is used for the target name in the final step. This causesproblems, if the linker will not be called, and there are several inputfiles on the command line. In this case, the name given with -o will beused for all of them, which makes the option pretty useless. Youshouldn't use -o when more than one output file is created.</P><DT><B><CODE>-t sys, --target sys</CODE></B><DD><P>The default for this option is different from the compiler and linker in thecase that the option is missing: While the other tools (compiler, assemblerand linker) will use the "none" system settings by default, cl65 will usethe C64 as a target system by default. This was choosen since most peopleseem to use cc65 to develop for the C64.</P></DL></P><HR><A HREF="cl65-3.html">Next</A><A HREF="cl65-1.html">Previous</A><A HREF="cl65.html#toc2">Contents</A></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -