User forums > Embedded development
cc65 (6502/6510) toolchain for hobbyist retro work -- need help...
DigitalMonk:
:oops: I appear to have missed KeyBinder under the Contrib plugins. D'oh! Rectifying that immediately...
MortenMacFly:
A few things to notice:
--- Quote from: DigitalMonk on May 21, 2010, 07:06:32 pm ---17. Set "Command line macro" to: cl65 -c -g -Oi -I ${APP_PATH}\..\cc65\include -L ${APP_PATH}\..\cc65\lib -o
--- End quote ---
Probably one can do it even better because you are mixing special with project specific parameters here.
I would use:
$compiler $options $includes -c -o $objects_output_dir$file_name.o $file
Make sure you've chosen "cl65.exe" as compiler in the compiler options. Put the include directory to the include directories for the compiler in the compiler's option. Then enable "-g" and "-Oi" in the build options of your project. Notice in addition that you don't need the library directory here at all.
--- Quote from: DigitalMonk on May 21, 2010, 07:06:32 pm ---20. Set "Command line macro" to: ld65 -v -t c64 -L ${APP_PATH}\..\cc65\lib\ -Ln $exe_dir\$exe_name.LBL -o $exe_dir\$exe_name.PRG $link_objects c64.lib
--- End quote ---
Same applies for the linker:
Use:
$linker $link_options $libdirs -Ln $exe_dir\$exe_name.LBL -o $exe_dir\$exe_name.PRG $link_objects $libs
Put -v -t c64 into the linker build options of your project (!) so you can select a different target platform, too. Also, put c64.lib as library to link against to your project's build options and add the RIGHT library directory for your target platform to the linker directories.
Finally: Make sure in the project you've just created you name the extension of output executable to "prg" and de-select to create the extension automatically in the build target options of the project properties.
This works very well for me for at least C64 and C128 target platform. :-)
DigitalMonk:
Hmmm... I was having problems with cl65 if I didn't specify the library path, because cl65 is the "compile and link" tool. (remember, I'm on a USB stick, so I've got no environment variables at all that I can rely on) I tried to use cc65 directly, but was having no luck there, either. And when I switched to using cl65, it insisted on being told where c64.lib was. But then, I'm just learning the cc65 toolchain as I go, so I probably just whiffed something (or several things).
Secondly, thank you for the suggestions. That's definitely a better way to do it. I suspect that I'll only ever do this one project, so it all works out the same for me, but anyone who is even remotely serious should do it your way.
Jenna:
--- Quote from: DigitalMonk on May 24, 2010, 05:30:35 pm ---[...]
(remember, I'm on a USB stick, so I've got no environment variables at all that I can rely on)
[...]
--- End quote ---
If you have a default.conf (or any other personality) on your usb-stick (you most likely have, because if not you would not have a compiler), you can use the "Environment variables"-plugin.
DigitalMonk:
--- Quote from: jens on May 24, 2010, 05:42:58 pm ---If you have a default.conf (or any other personality) on your usb-stick (you most likely have, because if not you would not have a compiler), you can use the "Environment variables"-plugin.
--- End quote ---
Ah, very handy. Thank you! Having the dev environment on a stick has been incredibly convenient.
I also just remembered why I quit trying to use cc65.exe and switched to "cl65.exe -c" instead. "cl65.exe -c" goes from .c -> .o in one step, but cl65.exe just goes .c->.s. I told the compile command for .c files that it would generate a like-named .s file, and then set up a rule for .s files that used ca65.exe, but somewhere along the way I just failed to get the chaining to work. When I got cl65.exe to compile .c's to object files, I was happy so I stopped there.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version