5 Compile and link utility for cc65
7 (C) Copyright 1999 Ullrich von Bassewitz
32 cl65 is a frontend for cc65, ca65 and ld65. While you may not use the full
33 power of the tools when calling them through cl65, most features are
34 available, and the use of cl65 is much simpler.
41 The cl65 compile and link utility may be used to compile, assemble and
42 link files. While the separate tools do just one step, cl65 knows how to
43 build object files from C files (by calling the compiler, then the
44 assembler) and other things.
46 Usage: cl65 [options] file
49 -C name Use linker config file
50 -D sym[=defn] Define a preprocessor symbol
51 -I path Set an include directory path
52 -Ln name Create a VICE label file
54 -Oi Optimize code, inline functions
55 -Or Optimize code, honour the register keyword
56 -Os Optimize code, inline known C funtions
57 -S Compile but don't assemble and link
58 -V Print the version number
60 -c Compiler and assemble but don't link
64 -m name Create a map file
65 -o name Name the output file
66 -t system Set the target system
70 Most of the options have the same meaning than the corresponding compiler,
71 assembler or linker option. If an option is available for more than one
72 of the tools, it is set for all tools, where it is available. One example
73 for this is -v: The compiler, the assembler and the linker are all called
76 There are a few remaining options that control the behaviour of cl65:
78 The -S option forces cl65 to stop after the assembly step. This means that
79 C files are translated into assembler files, but nothing more is done.
80 Assembler files, object files and libraries given on the command line are
83 The -c options forces cl65 to stop after the assembly step. This means
84 that C and assembler files given on the command line are translated into
85 object files, but there is no link step, and object files and libraries
86 given on the command line are ignored.
88 The -o option is used for the target name in the final step. This causes
89 problems, if the linker will not be called, and there are several input
90 files on the command line. In this case, the name given with -o will be
91 used for all of them, which makes the option pretty useless. You shouldn't
92 use -o when more than one output file is created.
94 The default for the -t option is different from the compiler and linker in
95 the case that the option is missing: While the compiler and linker will
96 use the "none" system settings by default, cl65 will use the C64 as a
97 target system by default. This was choosen since most people seem to use
98 cc65 to develop for the C64.
105 Since cl65 was created to simplify the use of the cc65 development
106 package, it tries to be smart about several things.
108 - If you don't give a target system on the command line, cl65
111 - When linking, cl65 will supply the names of the startup file and
112 library for the target system to the linker, so you don't have to do
115 - If the final step is the linker, and the name of the output file was
116 not explicitly given, cl65 will use the name of the first input file
117 without the extension, provided that the name of this file has an
118 extension. So you don't need to name the executable name in most
119 cases, just give the name of your "main" file as first input file.
126 The morse trainer software, which consists of one C file (morse.c) and one
127 assembler file (irq.s) will need the following separate steps to compile
128 into an executable named morse:
130 cc65 -g -Oi -t c64 morse.c
133 ld65 -t c64 -o morse c64.o morse.o irq.o c64.lib
135 When using cl65, this is simplified to
137 cl65 -g -Oi morse.c irq.s
140 As a general rule, you may use cl65 instead of cc65 at most times,
141 especially in makefiles to build object files directly from C files. Use
153 If you have problems using the utility, if you find any bugs, or if you're
154 doing something interesting with it, I would be glad to hear from you.
155 Feel free to contact me by email (uz@musoftware.de).
162 cl65 is (C) Copyright 1998 Ullrich von Bassewitz. For usage of the
163 binaries and/or sources the following conditions do apply:
165 This software is provided 'as-is', without any expressed or implied
166 warranty. In no event will the authors be held liable for any damages
167 arising from the use of this software.
169 Permission is granted to anyone to use this software for any purpose,
170 including commercial applications, and to alter it and redistribute it
171 freely, subject to the following restrictions:
173 1. The origin of this software must not be misrepresented; you must not
174 claim that you wrote the original software. If you use this software
175 in a product, an acknowledgment in the product documentation would be
176 appreciated but is not required.
177 2. Altered source versions must be plainly marked as such, and must not
178 be misrepresented as being the original software.
179 3. This notice may not be removed or altered from any source