The compiler translates one C source into one assembly source, for each invocation. It does not create object files directly, and it is not able to translate more than one file per run.
In the example above, we would use the following command line, to translate
hello.c
into hello.s
:
cc65 -O -I ../../include -t c64 hello.c
The -O
switch tells the compiler to do an additional optimizer run, which
is usually a good idea, since it makes the code smaller. If you don't care
about the size, but want to have slightly faster code, use -Oi
to inline
some runtime functions.
The -I
switch gives a search path for the include files. You may also set
the environment variable CC65_INC
to the search path.
The -t
switch is followed by the target system name.
If the compiler does not complain about errors in our "hello world" program, we
will have a file named "hello.s
", in our directory, that contains the
assembly source for the hello module.
For more information about the compiler, see cc65.html.