Page 1 of 1

ca65 on linux... writing a makefile ?

Posted: Sat Jan 29, 2011 4:30 pm
by jacky
dear nesdev folks,

i started learning asm code just a few weeks ago, as a first language.

i've been wading through the nerdy nights tutorials, but doing it the ca65 way, thanks to the "The Nerdy Nights ca65 Remix" made for mac users.

thing is im trying to do it on ubuntu.

anyway it all went pretty well, i completed most of the first part about graphics, making my .nes file with this command : cl65 -t nes -o myfile.nes myfile.asm

so now im learning the part about sound,
and im stuck at the point where i have several files to bind :

periods.asm ; the main code file
notetable.h
notetable.asm
periods.ch

when i try this command "cl65 -t nes -o periods.nes periods.asm" i get the following error :
note_table.h(1)
ld65: Error: 1 unresolved external(s) found - cannot create output file

i have also tried using the makefile provided with the tutorial, it doesn't work (or i dont know how it works) i suspect it works only for mac ?

can someone tell me how to assemble this to a .nes file ? i've been blocking on this for a week :/

do i have to write a "makefile" specific to linux ? if so how ?

the tutorial page and files im following are here
https://bitbucket.org/ddribin/nerdy-nig ... 3-periods/

thanks for your time

J.

Posted: Sat Jan 29, 2011 5:09 pm
by Ian A
Looks like you aren't compiling all the code.

Try:

Code: Select all

cl65 -t nes -o periods.nes periods.asm note_table.asm

The makefile works fine on linux. Typing make in the directory should work, provided that you downloaded all the tutorials in one big chunk. If you didn't, when you run 'make' it looks for 'common.mk' which it expects to be in a certain location, and when it can't find it, it borks out.

Posted: Sat Jan 29, 2011 5:54 pm
by jacky
ok ! wow i wish i could of guessed that by myself, i some how assumed it would all compile automatically, heh. thanks a lot, that's saved me quite some hassle, now im confident i'll get through the rest of the tutorial without too much trouble :)

bye now, thanks again

J.