Next Previous Contents

## 3. More usage

Since cl65 was created to simplify the use of the cc65 development package, it tries to be smart about several things.

- If you don't give a target system on the command line, cl65 defaults to the C64.
- When linking, cl65 will supply the names of the startup file and library for the target system to the linker, so you don't have to do that.
- If the final step is the linker, and the name of the output file was not explicitly given, cl65 will use the name of the first input file without the extension, provided that the name of this file has an extension. So you don't need to name the executable name in most cases, just give the name of your "main" file as first input file.

The command line is parsed from left to right, and the actual processing tool (compiler, assembler, ...) is invoked whenever a file name is encountered. This means that only the options to the left of a file name are in effect when this file is processed. It does also mean that you're able to specify different options for different files on the command line. As an example.

> `

>             cl65 -Oirs main.c -O -g module.c

> `

translates main.c with full optimization and module.c with less optimization and debug info enabled.

The type of an input file is derived from its extension:

- C files: `.c`
- Assembler files: `.s`, `.asm`, `.a65`
- Object files: `.o` `.obj`
- Libraries: `.a`, `.lib`
- GEOS resource files: `.grc`
- o65 files: `.o65`, `.emd`, `.joy`, `.tgi`

Please note that the program cannot handle input files with unknown file extensions.

Next Previous Contents