I'm working on getting the ArduPilot mega 2.x to compile outside the IDE using make (which will also allow it to be compiled in Eclipse, or NetBeans or whatever)
It is a work in progress :(
Is anyone else interested in this? otherwise I'll just do it for my own amusement.
So far I've found the following problems, which mainly relate to the way the Arduino IDE tries to auto-handle C function and variable prototype declarations.
1. Functions are used before being declared
2. Functions are marked static in a file, but are actually used by other files.
3. There is no .h file declaring all the global variables, structures and constants in use
My solution so far is to
1. Add declaration statements at the top of modules where functions, not necessarily externally useful ones that belong in proto.h, are used before the code for them.
2. Build up a proto.h file that is included by every file that is full of "extern .." declarations to define the functions and variables in use all over.
3. Remove "static" in front of functions that are in one file, but used externally to that file (are in proto.h)
As for the makefile, there is a generator written in ruby that does the job of creating the makefile automatically. It works ok, so that hasn't been a problem.
Once the compile errors are killed, and the hex file is created, I'll make sure it uploads it the same way the IDE does.
Basically all I want to do is muck around with the code base in a small filesystem tree, using vi. Then type "make" and "make install" to upload. The IDE was a nice fast start but now it gets in the way.