Next Previous Contents

4. Examples

The morse trainer software, which consists of one C file (morse.c) and one assembler file (irq.s) will need the following separate steps to compile into an executable named morse:

        cc65 -g -Oi -t c64 morse.c
        ca65 -g morse.s
        ca65 -g irq.s
        ld65 -t c64 -o morse c64.o morse.o irq.o c64.lib

When using cl65, this is simplified to

        cl65 -g -Oi morse.c irq.s

As a general rule, you may use cl65 instead of cc65 at most times, especially in makefiles to build object files directly from C files. Use

                cl65 -g -Oi $<

to do this.

Next Previous Contents