Arduino IDE's -- 'C' code generation and intermediate files

Is it possible to somehow intercept the IDE's build process, to isolate the intermediate 'C' files which use the avr-libc (and other Arduino libs), to study ?

Why bother when it's all open source and downloadable?

http://www.nongnu.org/avr-libc/

Should have worded my requirement and motivation more clearly.
What I'd like to do, while I am learning to program directly with avr-libc, is to compare / try-understand the Arduino (Java/C++ based) converted to C code, generated by IDE as a result of compile+verify step.

The pre-processed files generated by the Arduino IDE show up in the (java-determined) tmp directory that you can see if you turn on verbose compilation in the Arduino preferences, and you can look at them there.

Note that there is generally quite a bit less pre-processing than you seem to expect. An arduino sketch is C++ code, and the main thing that happens is that the IDE generates a set of function prototypes at the beginning of the code, before passing it to a real C++ compiler. There is no "conversion to C" step.

falcon74:
Should have worded my requirement and motivation more clearly.
What I'd like to do, while I am learning to program directly with avr-libc, is to compare / try-understand the Arduino (Java/C++ based) converted to C code, generated by IDE as a result of compile+verify step.

There's no conversion to C. The compiler accepts C++ directly and there's no Java.

This article was helpful when I had the same question:

http://arduino.cc/en/Hacking/BuildProcess

The short of it being, the IDE tidies up the sketch by merging all tabs into one file, adding prototypes, including library files in the build, and so on. But that's about it. Most of the "magic" is actually just C++ wrappers to add friendly functions and defines so you don't have to know so much about the hardware registers.

Moving to AVR C is fairly easy to do with Atmel Studio. You can even import the Arduino libs and write your programs in a "real" C++ IDE. That's actually a good way to go, because IMO, the Arduino IDE is really a horrible code editor, but the platform is so handy. :stuck_out_tongue: