These are some notes after fiddling around with the arduino sdk and the arduino-makefile. If you followed the install on my previous blog entry, you should now be able to compile a simple sketch and upload it to the arduino (e.g. the blink program).
First of all you should save your source files with .ino extension. .c or .cpp do not seem to be picked up by the makefile.
Now, to use any external libraries to drive some components, there are 2 ways I found to do it. Usually libraries come with a header file and a .cpp implementation file. You can place them in the same directory as your project, and after changing your headers to look in the current dir (i.e. replace the <mpla.h> with "mpla.h") and running make, the arduino makefile will pick them up, compile them and link them to your binary.
But things can get messy, especially if you want to use multiple libraries, or if these libraries require other standard libraries (like the SPI).Read on →