As the title says, I wish to compile sketches without using the Arduino IDE.
I already read the section on how to do it (Arduino "Build Process") and I think I'm close... the problem I'm running into now is the compiler not finding the libraries.
dc42:
How is EXTRAINCDIRS used? I've never seen += used in a makefile - are you sure it has the desired effect?
No, I'm not sure at all.
I just took a makefile from another project and modified it to my needs. I guess I didn't do it correctly.
I've tried all kinds of things. I've even used "#include /usr/share/whole/darn/path/to/library.h" in the source and it still fails.
So that's what I am trying to do... figure out how to compile a sketch without using the Arduino IDE.
As it is, I edit the source with NANO, then click the "upload" button on a very tiny Arduino IDE stuffed up in the corner of my screen. I'd like to get rid of it altogether and use a "real" IDE (oops I know that will bring some wrath down upon me!)
There are already several variants of a makefile that have been written to do just what you are (re)doing. I believe they all branch from a version by Martin Oldfield, which in turn stems from a version that actually came with earlier versions if the IDE (but is no longer officially supported.)
I use Martin Oldfield's current version with success. I use Emacs as my editor, and use the M-x compile cmd to invoke the makefile from within Emacs. The compiler warnings/error messages pop up in their own window, as usual, and clicking on any message will take you directly to that line in the file. So a bit more IDE than the "official" IDE, I guess, and certainly a better editor, but if you want integrated hardware debugging, you have to go to an Atmel product and their supporting hardware, at least at this stage. The debugging protocols are proprietary, and they're not telling, apparently.
I haven't tried any of the other variants available, so I can't really comment on relative advantages/disadvantages, but Martin Oldfield's version works fine for me.
Thank you all (especially PICO). The Makefile by Martin Oldfield worked perfectly. More importantly, it showed me what STEPS need to be done to make "bare" Arduino code compilable.