How does the Arduino IDE/build system work?

I noticed that they use the avr-gcc in the background, but what do they do on top?

They seem to have their own "kind of C" language that transforms into something that then compiles by avr-gcc.

Would someone like to spread some light on how it really works?

  • What language are they using?
  • Are they using something like Make in the background?
  • What intermediate files do they create? Can you listcompile a arduino file, or have a look at the generated AVR assambler?
  • \$\begingroup\$ I think the language is C, which is why avr-gcc can compile it. The setup() and loop() functions are just wrappers for other standard functions, ie loop is actually main() \$\endgroup\$ – dext0rb Apr 24 '12 at 19:03
  • \$\begingroup\$ Here's something that partially answers your question electronics.stackexchange.com/questions/22017/… \$\endgroup\$ – Jon L Apr 24 '12 at 19:19
  • \$\begingroup\$ @dext0rb actually it's c++ \$\endgroup\$ – vicatcu Apr 24 '12 at 20:37
  • \$\begingroup\$ I think we are both correct. "First, the Arduino environment performs some small transformations to make sure that the code is correct C or C++ (two common programming languages)." From the BuildProcess link below \$\endgroup\$ – dext0rb Apr 24 '12 at 21:03
  • \$\begingroup\$ @vicatcu Actually it's a subset of C++ \$\endgroup\$ – m.Alin Apr 24 '12 at 21:34

This page has everything you're looking for, straight from arduino's website.


| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.